Skip to content

Commit 68850c0

Browse files
committed
chore: apply prettier
1 parent a40092d commit 68850c0

7 files changed

Lines changed: 60 additions & 60 deletions

File tree

client/dist/index.js

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/dist/index.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/lib/code-sync.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ const reloader = new Reloader(window, log, Timer);
1111

1212
const options = {
1313
tagNames: {
14-
"css": "link",
15-
"jpg": "img",
16-
"jpeg": "img",
17-
"png": "img",
18-
"svg": "img",
19-
"gif": "img",
20-
"js": "script"
14+
css: "link",
15+
jpg: "img",
16+
jpeg: "img",
17+
png: "img",
18+
svg: "img",
19+
gif: "img",
20+
js: "script"
2121
},
2222
attrs: {
23-
"link": "href",
24-
"img": "src",
25-
"script": "src"
23+
link: "href",
24+
img: "src",
25+
script: "src"
2626
},
2727
blacklist: [
2828
// never allow .map files through
@@ -41,7 +41,6 @@ const current = function() {
4141
* @param {BrowserSync} bs
4242
*/
4343
sync.init = function(bs) {
44-
4544
if (bs.options.tagNames) {
4645
options.tagNames = bs.options.tagNames;
4746
}
@@ -160,7 +159,6 @@ sync.reload = function(bs) {
160159
}
161160

162161
if (data.basename && data.ext) {
163-
164162
if (sync.isBlacklisted(data)) {
165163
return;
166164
}

client/lib/utils.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,25 @@ export function getLocation(url: string) {
9494
* @param {string} suffix
9595
*/
9696
export function updateSearch(search, key, suffix) {
97-
9897
if (search === "") {
9998
return "?" + suffix;
10099
}
101100

102-
return "?" + search
103-
.slice(1)
104-
.split("&")
105-
.map(function (item) {
106-
return item.split("=");
107-
})
108-
.filter(function (tuple) {
109-
return tuple[0] !== key;
110-
})
111-
.map(function (item) {
112-
return [item[0], item[1]].join("=");
113-
})
114-
.concat(suffix)
115-
.join("&");
116-
};
101+
return (
102+
"?" +
103+
search
104+
.slice(1)
105+
.split("&")
106+
.map(function(item) {
107+
return item.split("=");
108+
})
109+
.filter(function(tuple) {
110+
return tuple[0] !== key;
111+
})
112+
.map(function(item) {
113+
return [item[0], item[1]].join("=");
114+
})
115+
.concat(suffix)
116+
.join("&")
117+
);
118+
}

crossbow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tasks:
22
build-all:
33
- lint
4+
- build-server
45
- build-client
5-
# - build-bs
66

77
build-server:
88
- '@npm tsc'

examples/less.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
var browserSync = require("browser-sync").create();
1717

1818
browserSync.init({
19-
server: ['test/fixtures'],
19+
server: ["test/fixtures"],
2020
open: false,
2121
watch: true,
22-
injectFileTypes: ['css', 'less'],
22+
injectFileTypes: ["css", "less"],
2323
middleware: [
2424
(req, res, next) => {
25-
if (req.url.indexOf('bootstrap.less') > -1) {
26-
res.setHeader('content-type', 'text/css');
25+
if (req.url.indexOf("bootstrap.less") > -1) {
26+
res.setHeader("content-type", "text/css");
2727
}
2828
next();
2929
}

0 commit comments

Comments
 (0)