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