Update internal-pattern.test.ts

This commit is contained in:
mmmsssttt404 2025-05-13 16:39:02 +08:00 committed by GitHub
parent 4badce6605
commit fba535b5ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -350,12 +350,11 @@ describe('pattern', () => {
describe('globEscape ReDos', () => {
it('done in 1s', () => {
const attackString = '['.repeat(100000) + '\u0000'
const attackString = `${'['.repeat(100000)}\u0000`
const startTime = performance.now()
Pattern.globEscape(attackString)
const endTime = performance.now()
const timeTaken = endTime - startTime
console.log(`globEscape: ${timeTaken.toFixed(3)} ms`)
expect(timeTaken).toBeLessThan(1000)
})
})