Use stream in build tools

This commit is contained in:
SukkaW
2023-08-07 21:06:07 +08:00
parent dc96df313b
commit 82519839f8
6 changed files with 72 additions and 79 deletions

View File

@@ -7,14 +7,15 @@
* @param {string[]} content
* @returns {string}
*/
const withBanner = (title, description, date, content) => {
return `########################################
# ${title}
# Last Updated: ${date.toISOString()}
# Size: ${content.length}
${description.map(line => (line ? `# ${line}` : '#')).join('\n')}
########################################\n${content.join('\n')}\n################# END ###################\n`;
};
// const withBanner = (title, description, date, content) => {
// return `########################################
// # ${title}
// # Last Updated: ${date.toISOString()}
// # Size: ${content.length}
// ${description.map(line => (line ? `# ${line}` : '#')).join('\n')}
// ########################################\n${content.join('\n')}\n################# END ###################\n`;
// };
/**
* @param {string} title
* @param {string[]} description
@@ -36,5 +37,5 @@ const withBannerArray = (title, description, date, content) => {
];
};
module.exports.withBanner = withBanner;
// module.exports.withBanner = withBanner;
module.exports.withBannerArray = withBannerArray;