mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 20:11:54 +08:00
New build infra
This commit is contained in:
@@ -6,12 +6,33 @@
|
||||
* @returns {string}
|
||||
*/
|
||||
const withBanner = (title, description, date, content) => {
|
||||
return `########################################
|
||||
return `########################################
|
||||
# ${title}
|
||||
${description.map(line => `# ${line}`).join('\n')}
|
||||
# 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
|
||||
* @param {Date} date
|
||||
* @param {string[]} content
|
||||
* @returns {string[]}
|
||||
*/
|
||||
const withBannerArray = (title, description, date, content) => {
|
||||
return [
|
||||
`########################################`,
|
||||
`# ${title}`,
|
||||
`# Last Updated: ${date.toISOString()}`,
|
||||
`# Size: ${content.length}`,
|
||||
...description.map(line => line ? `# ${line}` : '#'),
|
||||
`########################################`,
|
||||
...content,
|
||||
`################# END ###################`,
|
||||
''
|
||||
];
|
||||
};
|
||||
|
||||
module.exports.withBanner = withBanner;
|
||||
module.exports.withBannerArray = withBannerArray;
|
||||
|
||||
Reference in New Issue
Block a user