Buckets:
ktongue/docker_container / .cache /opencode /node_modules /fast-json-stringify /test /json-add-comma.test.js
| const { test } = require('node:test') | |
| const build = require('..') | |
| test('additionalProperties: false', (t) => { | |
| t.plan(1) | |
| const stringify = build({ | |
| title: 'additionalProperties', | |
| type: 'object', | |
| properties: { | |
| foo: { | |
| type: 'string' | |
| } | |
| }, | |
| additionalProperties: false | |
| }) | |
| const obj = { foo: 'a', bar: 'b', baz: 'c' } | |
| t.assert.equal(stringify(obj), '{"foo":"a"}') | |
| }) | |
| test('additionalProperties: {}', (t) => { | |
| t.plan(1) | |
| const stringify = build({ | |
| title: 'additionalProperties', | |
| type: 'object', | |
| properties: { | |
| foo: { | |
| type: 'string' | |
| } | |
| }, | |
| additionalProperties: {} | |
| }) | |
| const obj = { foo: 'a', bar: 'b', baz: 'c' } | |
| t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}') | |
| }) | |
| test('additionalProperties: {type: string}', (t) => { | |
| t.plan(1) | |
| const stringify = build({ | |
| title: 'additionalProperties', | |
| type: 'object', | |
| properties: { | |
| foo: { | |
| type: 'string' | |
| } | |
| }, | |
| additionalProperties: { | |
| type: 'string' | |
| } | |
| }) | |
| const obj = { foo: 'a', bar: 'b', baz: 'c' } | |
| t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}') | |
| }) | |
Xet Storage Details
- Size:
- 1.24 kB
- Xet hash:
- d6e5a85a6868d6be47b39a76c5aa240a4a623f8f8163ab891fdd0310be1b1ce0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.