Auto-commit 2026-04-29 16:31

This commit is contained in:
2026-04-29 16:31:27 -04:00
parent e8687bb6b2
commit 0495ee5bd2
19691 changed files with 3272886 additions and 138 deletions

33
node_modules/fast-json-stringify/test/regex.test.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
'use strict'
const test = require('tap').test
const validator = require('is-my-json-valid')
const build = require('..')
test('object with RexExp', (t) => {
t.plan(3)
const schema = {
title: 'object with RegExp',
type: 'object',
properties: {
reg: {
type: 'string'
}
}
}
const obj = {
reg: /"([^"]|\\")*"/
}
const stringify = build(schema)
const validate = validator(schema)
const output = stringify(obj)
JSON.parse(output)
t.pass()
t.equal(obj.reg.source, new RegExp(JSON.parse(output).reg).source)
t.ok(validate(JSON.parse(output)), 'valid schema')
})