mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 12:01:53 +08:00
Housekeeping
This commit is contained in:
@@ -3,8 +3,6 @@ require('chai').should();
|
||||
const Trie = require('./trie');
|
||||
const assert = require('assert');
|
||||
|
||||
var SENTINEL = Trie.SENTINEL;
|
||||
|
||||
describe('Trie', () => {
|
||||
it('should be possible to add items to a Trie.', () => {
|
||||
const trie = new Trie();
|
||||
@@ -57,7 +55,7 @@ describe('Trie', () => {
|
||||
assert.strictEqual(trie.delete(''), false);
|
||||
trie.delete('').should.eq(false);
|
||||
trie.delete('hello').should.eq(false);
|
||||
|
||||
|
||||
trie.delete('rat').should.eq(true);
|
||||
trie.has('rat').should.eq(false);
|
||||
trie.has('rate').should.eq(true);
|
||||
@@ -182,4 +180,4 @@ describe('surge domainset dedupe', () => {
|
||||
const trie = Trie.from(['skk.moe', 'sukkaskk.moe']);
|
||||
trie.find('.skk.moe').should.eql([]);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
@@ -12,8 +12,8 @@ const withBanner = (title, description, date, content) => {
|
||||
# ${title}
|
||||
# Last Updated: ${date.toISOString()}
|
||||
# Size: ${content.length}
|
||||
${description.map(line => line ? `# ${line}` : '#').join('\n')}
|
||||
########################################\n` + content.join('\n') + '\n################# END ###################\n';
|
||||
${description.map(line => (line ? `# ${line}` : '#')).join('\n')}
|
||||
########################################\n${content.join('\n')}\n################# END ###################\n`;
|
||||
};
|
||||
/**
|
||||
* @param {string} title
|
||||
@@ -24,14 +24,14 @@ ${description.map(line => line ? `# ${line}` : '#').join('\n')}
|
||||
*/
|
||||
const withBannerArray = (title, description, date, content) => {
|
||||
return [
|
||||
`########################################`,
|
||||
'########################################',
|
||||
`# ${title}`,
|
||||
`# Last Updated: ${date.toISOString()}`,
|
||||
`# Size: ${content.length}`,
|
||||
...description.map(line => line ? `# ${line}` : '#'),
|
||||
`########################################`,
|
||||
...description.map(line => (line ? `# ${line}` : '#')),
|
||||
'########################################',
|
||||
...content,
|
||||
`################# END ###################`,
|
||||
'################# END ###################',
|
||||
''
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user