Skip to content

Commit 92d7791

Browse files
committed
style: linting
1 parent b18c687 commit 92d7791

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,18 @@ test('invalid version does not cause catatrophic backtracking', t => {
173173
}
174174

175175
for (let index = 1; index <= 30; index++) {
176-
// Note reproduces attack string generated by https://devina.io/redos-checker
176+
// Attack string generated by https://devina.io/redos-checker
177177
const start = Date.now();
178178
const fixtures = [
179-
'0.0.1-i' + '--i-'.repeat(index) + '\x00',
179+
'0.0.1-i' + '--i-'.repeat(index) + '\u0000',
180180
'0' + ' 0.1.0-i0'.repeat(index) + '.1.1+1' + '1'.repeat(index) + 'A',
181-
'1.0.1--' + '-'.repeat(index) + '\x00',
182-
'g' + ' 0.0.1-i+'.repeat(index) + 'a' + 'v0'.repeat(index) + '\x00'
183-
]
184-
fixtures.forEach((fixture) => semverRegex().test(fixture));
181+
'1.0.1--' + '-'.repeat(index) + '\u0000',
182+
'g' + ' 0.0.1-i+'.repeat(index) + 'a' + 'v0'.repeat(index) + '\u0000',
183+
];
184+
for (const fixture of fixtures) {
185+
semverRegex().test(fixture);
186+
}
187+
185188
const difference = Date.now() - start;
186189
t.true(difference < 20, `Execution time: ${difference}`);
187190
}

0 commit comments

Comments
 (0)