-
Notifications
You must be signed in to change notification settings - Fork 1
Ranges
bhsd edited this page Mar 19, 2024
·
2 revisions
This is an internal document. For visitors, you can now go back to the home page.
// Ranges (main)
var {Range, Ranges} = require('../lib/ranges');
var ranges, target;
assert.deepStrictEqual([...new Ranges(2)], [2]);
assert.deepStrictEqual([...new Ranges(' ')], []);
assert.deepStrictEqual([...new Ranges('2')], [2]);
assert.deepStrictEqual([...new Ranges(1.5)], []);
assert.deepStrictEqual([...new Ranges('1.5')], []);
assert.deepStrictEqual([...new Ranges('1:2')], [new Range('1:2')]);
assert.deepStrictEqual([...new Ranges('-n+3')], [new Range('-n+3')]);
ranges = new Ranges([-100, ' ', '-2', 1.5, '1.5', '8:9', '-n+3']);
target = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
assert.deepStrictEqual(
[...ranges],
[-100, -2, new Range('8:9'), new Range('-n+3')],
);
assert.deepStrictEqual(ranges.applyTo(target), [0, 1, 2, 3, 8]);
对维基文本批量执行语法检查的命令行工具
用于维基文本的 ESLint 插件
A command-line tool that performs linting on Wikitext in bulk
ESLint plugin for Wikitext