Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 24fdb31

Browse files
committed
Formatted code.
1 parent f5a52ca commit 24fdb31

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
const Handlebars = require('handlebars');
22

3-
Handlebars.registerHelper('replaceNewLinesWithBR', block => block.replace(/[\r\n]+/g, '<br>'));
3+
Handlebars.registerHelper('replaceNewLinesWithBR', block =>
4+
block.replace(/[\r\n]+/gu, '<br>'));

index.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,42 @@ const admzip = require('adm-zip');
1616
* @public
1717
*/
1818

19-
const plugin = data => new Promise((resolve, reject) => {
19+
const plugin = data =>
20+
new Promise((resolve, reject) => {
2021

21-
const zip = new admzip();
22+
const zip = new admzip();
2223

23-
fs.readFile(path.join(__dirname, 'template.hbs'), 'utf8', (err, contents) => {
24+
fs.readFile(
25+
path.join(__dirname, 'template.hbs'),
26+
'utf8',
27+
(err, contents) => {
2428

25-
if (err) {
29+
if (err) {
2630

27-
return reject(err);
31+
return reject(err);
2832

29-
}
33+
}
3034

31-
const template = Handlebars.compile(contents);
35+
const template = Handlebars.compile(contents);
3236

33-
data.files.forEach(file => {
37+
data.files.forEach(file => {
3438

35-
file.methods.forEach(method => {
39+
file.methods.forEach(method => {
3640

37-
zip.addFile(
38-
`${file.name}/${method.name}.md`,
39-
template(method)
40-
);
41+
zip.addFile(
42+
`${file.name}/${method.name}.md`,
43+
template(method)
44+
);
4145

42-
});
46+
});
4347

44-
});
48+
});
4549

46-
return resolve(zip.toBuffer());
50+
return resolve(zip.toBuffer());
4751

48-
});
52+
}
53+
);
4954

50-
});
55+
});
5156

5257
module.exports = plugin;

0 commit comments

Comments
 (0)