fatsify核心功能示例测试!!!
This commit is contained in:
18
node_modules/fast-json-stringify/test/sanitize2.test.js
generated
vendored
Normal file
18
node_modules/fast-json-stringify/test/sanitize2.test.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('node:test')
|
||||
const build = require('..')
|
||||
|
||||
test('sanitize 2', t => {
|
||||
const payload = '(throw "pwoned")'
|
||||
|
||||
const stringify = build({
|
||||
properties: {
|
||||
[`*///\\\\\\']);${payload};{/*`]: {
|
||||
type: 'number'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
t.assert.doesNotThrow(() => stringify({}))
|
||||
})
|
||||
Reference in New Issue
Block a user