Files
simple-mail-cleaner/backend/node_modules/fast-json-stringify/test/sanitize5.test.js
2026-01-22 15:49:12 +01:00

17 lines
357 B
JavaScript

'use strict'
const t = require('tap')
const build = require('..')
const payload = '(throw "pwoned")'
const expected = 'Error: Invalid regular expression: /*/: Nothing to repeat. Found at * matching {"type":"*/(throw \\"pwoned\\")){//"}'
t.throws(() => {
build({
patternProperties: {
'*': { type: `*/${payload}){//` }
}
})
}, expected)