Skip to content

Commit f91789b

Browse files
committed
format code
1 parent 56564fe commit f91789b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2020-2021 TNTWeb
3+
Copyright (c) 2020-2021 drawcall
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

examples/index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const polyfill = () => {
2121
global.document = { body };
2222

2323
const baseUrl = path.join(__dirname);
24-
const paths = p => path.join(baseUrl, p);
24+
const paths = (p) => path.join(baseUrl, p);
2525
global.paths = paths;
2626
};
2727

28-
const processingJson = data => {
28+
const processingJson = (data) => {
2929
const json = [];
3030
for (let key in data) {
3131
const list = data[key];
@@ -34,30 +34,30 @@ const processingJson = data => {
3434
json.push({
3535
name: key + "::" + item.title,
3636
value: item.title,
37-
func: demoFunc(`${key}/${item.entry}`)
37+
func: demoFunc(`${key}/${item.entry}`),
3838
});
3939
}
4040
}
4141

4242
json.push({
4343
name: "Clear cache",
4444
value: "Clear cache",
45-
func: removeFiles
45+
func: removeFiles,
4646
});
4747

4848
json.push(new inquirer.Separator());
4949
return json;
5050
};
5151

5252
let now;
53-
const screenshots = name => {
53+
const screenshots = (name) => {
5454
name = name.replace(/\//gi, "-");
5555
const dir = path.join(__dirname, "output", name);
5656
fs.ensureDir(dir);
5757
id = setInterval(saveFiles, 1000 / 2, dir);
5858
};
5959

60-
const saveFiles = dir => {
60+
const saveFiles = (dir) => {
6161
if (index >= 20) {
6262
clearInterval(id);
6363
index = 0;
@@ -71,7 +71,7 @@ const saveFiles = dir => {
7171
fs.outputFile(file, buffer);
7272
};
7373

74-
const demoFunc = name => {
74+
const demoFunc = (name) => {
7575
const url = path.join(__dirname, "./source/node/", `${name}`);
7676

7777
return () => {
@@ -81,7 +81,7 @@ const demoFunc = name => {
8181
};
8282

8383
const choices = processingJson(data);
84-
const runDemo = answer => {
84+
const runDemo = (answer) => {
8585
for (let i = 0; i < choices.length; i++) {
8686
const choice = choices[i];
8787
if (choice.value === answer.val) {
@@ -105,13 +105,13 @@ const initCommand = () => {
105105
name: "val",
106106
choices,
107107
pageSize: choices.length,
108-
validate: function(answer) {
108+
validate: function (answer) {
109109
if (answer.length < 1) {
110110
return "You must choose at least one topping.";
111111
}
112112
return true;
113-
}
114-
}
113+
},
114+
},
115115
])
116116
.then(runDemo);
117117
};

0 commit comments

Comments
 (0)