Buckets:
| const { test } = require('node: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) | |
| t.assert.doesNotThrow(() => JSON.parse(output)) | |
| t.assert.equal(obj.reg.source, new RegExp(JSON.parse(output).reg).source) | |
| t.assert.ok(validate(JSON.parse(output)), 'valid schema') | |
| }) | |
Xet Storage Details
- Size:
- 661 Bytes
- Xet hash:
- a5ed6e3bf114b7070a3e4d36710bd5b7e63ff35a5c798b595f5b3ccd86d38025
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.