{"_id":"@eslint/object-schema","_rev":"4281127","name":"@eslint/object-schema","description":"An object schema merger/validator","dist-tags":{"latest":"3.0.4"},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"time":{"modified":"2026-04-07T20:03:29.000Z","created":"2024-05-30T20:40:23.310Z","3.0.4":"2026-04-03T20:02:59.835Z","3.0.3":"2026-03-06T22:25:33.621Z","3.0.2":"2026-02-20T14:31:51.682Z","3.0.1":"2026-02-07T00:02:07.436Z","3.0.0":"2025-11-14T16:30:15.065Z","2.1.7":"2025-10-17T17:58:12.617Z","2.1.6":"2025-01-31T17:22:46.772Z","2.1.5":"2024-12-04T21:23:28.907Z","2.1.4":"2024-06-12T14:31:33.901Z","2.1.3":"2024-05-30T20:40:23.310Z"},"users":{},"author":{"name":"Nicholas C. Zakas"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"versions":{"3.0.4":{"name":"@eslint/object-schema","version":"3.0.4","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","lint:types":"attw --pack","pretest":"npm run build","test":"npm run test:types && npm run test:unit","test:coverage":"c8 npm run test:unit","test:jsr":"npx -y jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json","test:unit":"mocha \"tests/**/*.test.js\""},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"gitHead":"fe114eed69c5d59d0dd05cda8071a5b98c4daec2","_id":"@eslint/object-schema@3.0.4","_nodeVersion":"24.14.1","_npmVersion":"11.12.1","dist":{"shasum":"8ce3aff08f6ca7c3bd9e1cec34530fc7fb44546a","size":11778,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-3.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-3.0.4.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_3.0.4_1775246579708_0.3096490352139829"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-04-03T20:02:59.835Z","publish_time":1775246579835,"_source_registry_name":"default","_cnpm_publish_time":1775246579835},"3.0.3":{"name":"@eslint/object-schema","version":"3.0.3","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","lint:types":"attw --pack","pretest":"npm run build","test":"npm run test:types && npm run test:unit","test:coverage":"c8 npm run test:unit","test:jsr":"npx -y jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json","test:unit":"mocha \"tests/**/*.test.js\""},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"gitHead":"41eb19fbdd81a778a2feb362f11172278063f785","_id":"@eslint/object-schema@3.0.3","_nodeVersion":"24.14.0","_npmVersion":"11.11.0","dist":{"shasum":"5bf671e52e382e4adc47a9906f2699374637db6b","size":12670,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-3.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-3.0.3.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_3.0.3_1772835933453_0.5984725769559418"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-06T22:25:33.621Z","publish_time":1772835933621,"_source_registry_name":"default","_cnpm_publish_time":1772835933621},"3.0.2":{"name":"@eslint/object-schema","version":"3.0.2","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","lint:types":"attw --pack","pretest":"npm run build","test":"npm run test:types && npm run test:unit","test:coverage":"c8 npm run test:unit","test:jsr":"npx -y jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json","test:unit":"mocha \"tests/**/*.test.js\""},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"gitHead":"1030f06ab63357c7ada784489d68bb4ddd092f7f","_id":"@eslint/object-schema@3.0.2","_nodeVersion":"24.13.0","_npmVersion":"11.10.1","dist":{"shasum":"c59c6a94aa4b428ed7f1615b6a4495c0a21f7a22","size":11934,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-3.0.2.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_3.0.2_1771597911534_0.7848793455890284"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-20T14:31:51.682Z","publish_time":1771597911682,"_source_registry_name":"default","_cnpm_publish_time":1771597911682},"3.0.1":{"name":"@eslint/object-schema","version":"3.0.1","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","lint:types":"attw --pack","pretest":"npm run build","test":"npm run test:types && npm run test:unit","test:coverage":"c8 npm run test:unit","test:jsr":"npx -y jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json","test:unit":"mocha \"tests/**/*.test.js\""},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"gitHead":"0f972f9282d1babf881deeb12b01375f1147d24f","_id":"@eslint/object-schema@3.0.1","_nodeVersion":"24.13.0","_npmVersion":"11.9.0","dist":{"shasum":"9a1dc9af00d790dc79a9bf57a756e3cb2740ddb9","size":11205,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-3.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_3.0.1_1770422527218_0.3342435392610974"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-07T00:02:07.436Z","publish_time":1770422527436,"_source_registry_name":"default","_cnpm_publish_time":1770422527436},"3.0.0":{"name":"@eslint/object-schema","version":"3.0.0","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","test":"mocha \"tests/**/*.test.js\"","test:coverage":"c8 npm test","test:jsr":"npx jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^20.19.0 || ^22.13.0 || >=24"},"gitHead":"c368656dbba4d927344905f24b3993a378a59a88","_id":"@eslint/object-schema@3.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"shasum":"0efb4cf93d529ef7f4f66d3f8490e3bfcf1550f4","size":11078,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-3.0.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_3.0.0_1763137814842_0.1594137400573059"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-14T16:30:15.065Z","publish_time":1763137815065,"_source_registry_name":"default","_cnpm_publish_time":1763137815065},"2.1.7":{"name":"@eslint/object-schema","version":"2.1.7","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:dedupe-types":"node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js","build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts","test":"mocha \"tests/**/*.test.js\"","test:coverage":"c8 npm test","test:jsr":"npx jsr@latest publish --dry-run","test:types":"tsc -p tests/types/tsconfig.json"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git","directory":"packages/object-schema"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","devDependencies":{"rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"gitHead":"df12d9a67c9fdf7959ae79bd2f49462656d474f5","_id":"@eslint/object-schema@2.1.7","_nodeVersion":"22.20.0","_npmVersion":"11.6.2","dist":{"shasum":"6e2126a1347e86a4dedf8706ec67ff8e107ebbad","size":11106,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-2.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-2.1.7.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1295a891-c6bd-4729-9ef7-41e7903845dc"}},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_2.1.7_1760723892437_0.43865086000504117"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-17T17:58:12.617Z","publish_time":1760723892617,"_source_registry_name":"default","_cnpm_publish_time":1760723892617},"2.1.6":{"name":"@eslint/object-schema","version":"2.1.6","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:cts":"node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts","build":"rollup -c && tsc -p tsconfig.esm.json && npm run build:cts","test:jsr":"npx jsr@latest publish --dry-run","test":"mocha tests/","test:coverage":"c8 npm test"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite#readme","devDependencies":{"c8":"^9.1.0","mocha":"^10.4.0","rollup":"^4.16.2","rollup-plugin-copy":"^3.5.0","typescript":"^5.4.5"},"engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"_id":"@eslint/object-schema@2.1.6","gitHead":"e1cb6037bc237313dbf3f6a7b9f5cd3c3105b668","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"shasum":"58369ab5b5b3ca117880c0f6c0b0f32f6950f24f","size":10883,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-2.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-2.1.6.tgz"},"_npmUser":{"name":"eslintbot","email":"nicholas@eslint.org"},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/object-schema_2.1.6_1738344166529_0.8094857111733287"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-31T17:22:46.772Z","publish_time":1738344166772,"_source_registry_name":"default","_cnpm_publish_time":1738344166772},"2.1.5":{"name":"@eslint/object-schema","version":"2.1.5","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:cts":"node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"","build":"rollup -c && tsc -p tsconfig.esm.json && npm run build:cts","test:jsr":"npx jsr@latest publish --dry-run","test":"mocha tests/","test:coverage":"c8 npm test"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite#readme","devDependencies":{"c8":"^9.1.0","mocha":"^10.4.0","rollup":"^4.16.2","rollup-plugin-copy":"^3.5.0","typescript":"^5.4.5"},"engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"_id":"@eslint/object-schema@2.1.5","gitHead":"dd8d161c635450f3e37109f833737bf69f54db55","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"shasum":"8670a8f6258a2be5b2c620ff314a1d984c23eb2e","size":10917,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-2.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-2.1.5.tgz"},"_npmUser":{"name":"eslintbot","email":"nicholas@eslint.org"},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/object-schema_2.1.5_1733347408751_0.3211997724344855"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-04T21:23:28.907Z","publish_time":1733347408907,"_source_registry_name":"default","_cnpm_publish_time":1733347408907},"2.1.4":{"name":"@eslint/object-schema","version":"2.1.4","description":"An object schema merger/validator","type":"module","main":"dist/esm/index.js","types":"dist/esm/index.d.ts","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:cts":"node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"","build":"rollup -c && tsc -p tsconfig.esm.json && npm run build:cts","test:jsr":"npx jsr@latest publish --dry-run","test":"mocha tests/","test:coverage":"c8 npm test"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite#readme","devDependencies":{"c8":"^9.1.0","mocha":"^10.4.0","rollup":"^4.16.2","rollup-plugin-copy":"^3.5.0","typescript":"^5.4.5"},"engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"_id":"@eslint/object-schema@2.1.4","gitHead":"2a7bed41976f94495f7ba46f459f1de9d3305664","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"shasum":"9e69f8bb4031e11df79e03db09f9dbbae1740843","size":10586,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-2.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-2.1.4.tgz"},"_npmUser":{"name":"eslintbot","email":"nicholas+eslint@nczconsulting.com"},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/object-schema_2.1.4_1718202693724_0.9989908493722703"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-12T14:31:33.901Z","publish_time":1718202693901,"_source_registry_name":"default","_cnpm_publish_time":1718202693901},"2.1.3":{"name":"@eslint/object-schema","version":"2.1.3","description":"An object schema merger/validator","type":"module","exports":{"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"publishConfig":{"access":"public"},"directories":{"test":"tests"},"scripts":{"build:cts":"node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"","build":"rollup -c && tsc -p tsconfig.esm.json && npm run build:cts","test:jsr":"npx jsr@latest publish --dry-run","test":"mocha tests/"},"repository":{"type":"git","url":"git+https://github.com/eslint/rewrite.git"},"keywords":["object","validation","schema","merge"],"author":{"name":"Nicholas C. Zakas"},"license":"Apache-2.0","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"homepage":"https://github.com/eslint/rewrite#readme","devDependencies":{"mocha":"^10.4.0","rollup":"^4.16.2","typescript":"^5.4.5","rollup-plugin-copy":"^3.5.0"},"engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"_id":"@eslint/object-schema@2.1.3","gitHead":"12012ffea9128c8c5cc035d3806a128308b26186","_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"shasum":"e65ae80ee2927b4fd8c5c26b15ecacc2b2a6cc2a","size":9744,"noattachment":false,"key":"/@eslint/object-schema/-/@eslint/object-schema-2.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@eslint/object-schema/download/@eslint/object-schema-2.1.3.tgz"},"_npmUser":{"name":"eslintbot","email":"nicholas+eslint@nczconsulting.com"},"maintainers":[{"name":"eslintbot","email":""},{"name":"openjsfoundation","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/object-schema_2.1.3_1717101623079_0.8190393680536692"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-05-30T20:40:23.310Z","publish_time":1717101623310,"_source_registry_name":"default","_cnpm_publish_time":1717101623310}},"readme":"# ObjectSchema Package\n\n## Overview\n\nA JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. This is used in the [`@eslint/config-array`](https://npmjs.com/package/@eslint/config-array) package but can also be used on its own.\n\n## Installation\n\nFor Node.js and compatible runtimes:\n\n```shell\nnpm install @eslint/object-schema\n# or\nyarn add @eslint/object-schema\n# or\npnpm install @eslint/object-schema\n# or\nbun add @eslint/object-schema\n```\n\nFor Deno:\n\n```shell\ndeno add @eslint/object-schema\n```\n\n## Usage\n\nImport the `ObjectSchema` constructor:\n\n```js\n// using ESM\nimport { ObjectSchema } from \"@eslint/object-schema\";\n\n// using CommonJS\nconst { ObjectSchema } = require(\"@eslint/object-schema\");\n\nconst schema = new ObjectSchema({\n\t// define a definition for the \"downloads\" key\n\tdownloads: {\n\t\trequired: true,\n\t\tmerge(value1 = 0, value2) {\n\t\t\treturn value1 + value2;\n\t\t},\n\t\tvalidate(value) {\n\t\t\tif (typeof value !== \"number\") {\n\t\t\t\tthrow new Error(\"Expected downloads to be a number.\");\n\t\t\t}\n\t\t},\n\t},\n\n\t// define a strategy for the \"versions\" key\n\tversions: {\n\t\trequired: true,\n\t\tmerge(value1 = [], value2) {\n\t\t\treturn value1.concat(value2);\n\t\t},\n\t\tvalidate(value) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthrow new Error(\"Expected versions to be an array.\");\n\t\t\t}\n\t\t},\n\t},\n});\n\nconst record1 = {\n\tdownloads: 25,\n\tversions: [\"v1.0.0\", \"v1.1.0\", \"v1.2.0\"],\n};\n\nconst record2 = {\n\tdownloads: 125,\n\tversions: [\"v2.0.0\", \"v2.1.0\", \"v3.0.0\"],\n};\n\n// make sure the records are valid\nschema.validate(record1);\nschema.validate(record2);\n\n// merge together (schema.merge() accepts any number of objects)\nconst result = schema.merge(record1, record2);\n\n// result looks like this:\n// {\n// \tdownloads: 150,\n// \tversions: [\"v1.0.0\", \"v1.1.0\", \"v1.2.0\", \"v2.0.0\", \"v2.1.0\", \"v3.0.0\"],\n// }\n```\n\n## Tips and Tricks\n\n### Named merge strategies\n\nInstead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy:\n\n- `\"assign\"` - use `Object.assign()` to merge the two values into one object.\n- `\"overwrite\"` - the second value always replaces the first.\n- `\"replace\"` - the second value replaces the first if the second is not `undefined`.\n\nFor example:\n\n```js\nconst schema = new ObjectSchema({\n\tname: {\n\t\tmerge: \"replace\",\n\t\tvalidate() {},\n\t},\n});\n```\n\n### Named validation strategies\n\nInstead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy:\n\n- `\"array\"` - value must be an array.\n- `\"boolean\"` - value must be a boolean.\n- `\"number\"` - value must be a number.\n- `\"object\"` - value must be a non-null object, including arrays and non-plain objects.\n- `\"object?\"` - value must be an object or null, including arrays and non-plain objects.\n- `\"string\"` - value must be a string.\n- `\"string!\"` - value must be a non-empty string.\n\nFor example:\n\n```js\nconst schema = new ObjectSchema({\n\tname: {\n\t\tmerge: \"replace\",\n\t\tvalidate: \"string\",\n\t},\n});\n```\n\n### Built-in strategy classes\n\nThe package also exports the built-in merge and validation strategies as two classes with static methods:\n\n- `MergeStrategy` - built-in merge functions (`assign`, `overwrite`, `replace`).\n- `ValidationStrategy` - built-in validation functions (`array`, `boolean`, `number`, `object`, `object?`, `string`, `string!`).\n\nThese are the same strategies used when you specify a strategy by name (for example, `merge: \"replace\"`). You can reference the functions directly if you prefer passing a function instead of a string:\n\n```js\nimport {\n\tObjectSchema,\n\tMergeStrategy,\n\tValidationStrategy,\n} from \"@eslint/object-schema\";\n\nconst schema = new ObjectSchema({\n\tname: {\n\t\trequired: true,\n\t\tmerge: MergeStrategy.replace,\n\t\tvalidate: ValidationStrategy[\"string!\"],\n\t},\n\toptions: {\n\t\trequired: false,\n\t\tmerge: MergeStrategy.assign,\n\t\tvalidate: ValidationStrategy[\"object?\"],\n\t},\n});\n```\n\nNote: Because `object?` and `string!` aren't valid identifiers, you must access them using bracket notation (for example, `ValidationStrategy[\"object?\"]`).\n\n### Subschemas\n\nIf you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, set a `schema` property that contains a schema definition, like this:\n\n```js\nconst schema = new ObjectSchema({\n\tname: {\n\t\tschema: {\n\t\t\tfirst: {\n\t\t\t\tmerge: \"replace\",\n\t\t\t\tvalidate: \"string\",\n\t\t\t},\n\t\t\tlast: {\n\t\t\t\tmerge: \"replace\",\n\t\t\t\tvalidate: \"string\",\n\t\t\t},\n\t\t},\n\t},\n});\n\nschema.validate({\n\tname: {\n\t\tfirst: \"n\",\n\t\tlast: \"z\",\n\t},\n});\n```\n\n### Remove Keys During Merge\n\nIf the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example:\n\n```js\nconst schema = new ObjectSchema({\n\tdate: {\n\t\tmerge() {\n\t\t\treturn undefined;\n\t\t},\n\t\tvalidate(value) {\n\t\t\tif (isNaN(Date.parse(value))) {\n\t\t\t\tthrow new Error(\"Invalid date.\");\n\t\t\t}\n\t\t},\n\t},\n});\n\nconst object1 = { date: \"5/5/2005\" };\nconst object2 = { date: \"6/6/2006\" };\n\nconst result = schema.merge(object1, object2);\n\nconsole.log(\"date\" in result); // false\n```\n\n### Requiring Another Key Be Present\n\nIf you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example:\n\n```js\nconst schema = new ObjectSchema({\n\tdate: {\n\t\tmerge() {\n\t\t\treturn undefined;\n\t\t},\n\t\tvalidate(value) {\n\t\t\tif (isNaN(Date.parse(value))) {\n\t\t\t\tthrow new Error(\"Invalid date.\");\n\t\t\t}\n\t\t},\n\t},\n\ttime: {\n\t\trequires: [\"date\"],\n\t\tmerge(first, second) {\n\t\t\treturn second;\n\t\t},\n\t\tvalidate(value) {\n\t\t\t// ...\n\t\t},\n\t},\n});\n\n// throws error: Key \"time\" requires keys \"date\".\nschema.validate({\n\ttime: \"13:45\",\n});\n```\n\nIn this example, even though `date` is an optional key, it is required to be present whenever `time` is present.\n\n## License\n\nApache 2.0\n\n<!-- NOTE: This section is autogenerated. Do not manually edit.-->\n<!--sponsorsstart-->\n\n## Sponsors\n\nThe following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)\nto get your logo on our READMEs and [website](https://eslint.org/sponsors).\n\n<h3>Platinum Sponsors</h3>\n<p><a href=\"https://automattic.com\"><img src=\"https://images.opencollective.com/automattic/d0ef3e1/logo.png\" alt=\"Automattic\" height=\"128\"></a></p><h3>Gold Sponsors</h3>\n<p><a href=\"https://qlty.sh/\"><img src=\"https://images.opencollective.com/qltysh/33d157d/logo.png\" alt=\"Qlty Software\" height=\"96\"></a></p><h3>Silver Sponsors</h3>\n<p><a href=\"https://vite.dev/\"><img src=\"https://images.opencollective.com/vite/d472863/logo.png\" alt=\"Vite\" height=\"64\"></a> <a href=\"https://liftoff.io/\"><img src=\"https://images.opencollective.com/liftoff/2d6c3b6/logo.png\" alt=\"Liftoff\" height=\"64\"></a> <a href=\"https://stackblitz.com\"><img src=\"https://avatars.githubusercontent.com/u/28635252\" alt=\"StackBlitz\" height=\"64\"></a></p><h3>Bronze Sponsors</h3>\n<p><a href=\"https://cybozu.co.jp/\"><img src=\"https://images.opencollective.com/cybozu/933e46d/logo.png\" alt=\"Cybozu\" height=\"32\"></a> <a href=\"https://opensource.sap.com\"><img src=\"https://avatars.githubusercontent.com/u/2531208\" alt=\"SAP\" height=\"32\"></a> <a href=\"https://www.crawljobs.com/\"><img src=\"https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png\" alt=\"CrawlJobs\" height=\"32\"></a> <a href=\"#\"><img src=\"https://images.opencollective.com/aeriusventilations-org/avatar.png\" alt=\"aeriusventilation's Org\" height=\"32\"></a> <a href=\"https://depot.dev\"><img src=\"https://images.opencollective.com/depot/39125a1/logo.png\" alt=\"Depot\" height=\"32\"></a> <a href=\"https://icons8.com/\"><img src=\"https://images.opencollective.com/icons8/7fa1641/logo.png\" alt=\"Icons8\" height=\"32\"></a> <a href=\"https://discord.com\"><img src=\"https://images.opencollective.com/discordapp/f9645d9/logo.png\" alt=\"Discord\" height=\"32\"></a> <a href=\"https://www.gitbook.com\"><img src=\"https://avatars.githubusercontent.com/u/7111340\" alt=\"GitBook\" height=\"32\"></a> <a href=\"https://herocoders.com\"><img src=\"https://avatars.githubusercontent.com/u/37549774\" alt=\"HeroCoders\" height=\"32\"></a> <a href=\"https://www.lambdatest.com\"><img src=\"https://avatars.githubusercontent.com/u/171592363\" alt=\"TestMu AI Open Source Office (Formerly LambdaTest)\" height=\"32\"></a></p>\n<h3>Technology Sponsors</h3>\nTechnology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.\n<p><a href=\"https://netlify.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg\" alt=\"Netlify\" height=\"32\"></a> <a href=\"https://algolia.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg\" alt=\"Algolia\" height=\"32\"></a> <a href=\"https://1password.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg\" alt=\"1Password\" height=\"32\"></a></p>\n<!--sponsorsend-->\n","_attachments":{},"homepage":"https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme","bugs":{"url":"https://github.com/eslint/rewrite/issues"},"license":"Apache-2.0"}