
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@unts/json-schema-migrate
Advanced tools
Migrate JSON-Schema `draft-04` to `draft-07`, `draft-2019-09` or `draft-2020-12`
This is an actively maintained fork of json-schema-migrate which helps migrate JSON-Schema from draft-04 to draft-07, draft-2019-09 or draft-2020-12.
# npm
npm install @unts/json-schema-migrate
# yarn
yarn add @unts/json-schema-migrate
# pnpm
pnpm add @unts/json-schema-migrate
# bun
bun add @unts/json-schema-migrate
import * as migrate from '@unts/json-schema-migrate'
const schema = {
id: 'my-schema',
minimum: 1,
exclusiveMinimum: true,
}
migrate.draft7(schema)
// or migrate.draft2019(schema)
// or migrate.draft2020(schema)
console.log(schema)
// {
// $id: 'my-schema',
// exclusiveMinimum: 1
// }
You can access Ajv instance that is used to migrate schema using migrate.getAjv function:
console.log(migrate.getAjv().errorsText(errors))
id is replaced with $id$schema value becomes draft-07, draft-2019-09 or draft-2020-12 meta-schemadraft-04 boolean form of exclusiveMaximum/Minimum is replaced with the current number formenum with a single allowed value is replaced with constconstant is replaced with consttrue{"not":{}} is replaced with falsedraft2019 function additionally replaces:
dependencies with dependentRequired and dependentSchemas"id": "#foo" with "$anchor": "foo""id": "schema#foo" with "$id": "schema", "$anchor": "foo"draft2020 function additionally replaces array form of items with prefixItems (and additionalItems with items)| 1stG | RxTS | UnTS |
|---|---|---|
| 1stG | RxTS | UnTS |
|---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.
FAQs
Migrate JSON-Schema `draft-04` to `draft-07`, `draft-2019-09` or `draft-2020-12`
We found that @unts/json-schema-migrate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.