From b0bdc353aca1cf00c0e8c59ca59ab2af492418b4 Mon Sep 17 00:00:00 2001 From: karan-palan Date: Mon, 22 Sep 2025 11:50:24 +0530 Subject: [PATCH 1/3] feat(linting): introduce jsonschema cli for linting and autofixing linting issues in schemas Signed-off-by: karan-palan --- README.md | 22 ++ package.json | 10 +- test/lint.test.ts | 37 +++ typescript-json-schema-cli.ts | 9 + typescript-json-schema.ts | 101 ++++++- yarn.lock | 546 +++++++++------------------------- 6 files changed, 306 insertions(+), 419 deletions(-) create mode 100644 test/lint.test.ts diff --git a/README.md b/README.md index 1707e43b..84119338 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,30 @@ Options: --defaultNumberType Default number type. [choices: "number", "integer"] [default: "number"] --tsNodeRegister Use ts-node/register (needed for require typescript files). [boolean] [default: false] --constAsEnum Use enums with a single value when declaring constants. [boolean] [default: false] + --lint Lint generated schemas for JSON Schema best practices. [boolean] [default: false] + --fix Automatically fix linting issues in generated schemas. [boolean] [default: false] + --lintStrict Enable strict linting rules for generated schemas. [boolean] [default: false] --experimentalDecorators Use experimentalDecorators when loading typescript modules. [boolean] [default: true] ``` +#### JSON Schema Linting + +This tool integrates with [@sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) to provide JSON Schema linting capabilities. You can automatically validate and fix your generated schemas to follow JSON Schema best practices. + +**Example usage:** + +```bash +# Generate schema with linting enabled +typescript-json-schema types.ts MyType --lint --out schema.json + +# Generate schema with automatic fixes applied +typescript-json-schema types.ts MyType --fix --out schema.json + +# Generate schema with strict linting rules +typescript-json-schema types.ts MyType --lint --lintStrict --out schema.json +``` + ### Programmatic use ```ts @@ -66,6 +86,8 @@ import * as TJS from "typescript-json-schema"; // optionally pass argument to schema generator const settings: TJS.PartialArgs = { required: true, + lint: true, // Enable linting + fix: true, // Automatically fix linting issues }; // optionally pass ts compiler options diff --git a/package.json b/package.json index ca74a2f9..dd17826c 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,7 @@ "description": "typescript-json-schema generates JSON Schema files from your Typescript sources", "main": "dist/typescript-json-schema.js", "typings": "dist/typescript-json-schema.d.ts", - "bin": { - "typescript-json-schema": "./bin/typescript-json-schema" - }, + "bin": "./bin/typescript-json-schema", "author": "Yousef El-Dardiry and Dominik Moritz", "contributors": [ { @@ -51,6 +49,7 @@ "yargs": "^17.1.1" }, "devDependencies": { + "@sourcemeta/jsonschema": "^11.8.2", "@types/chai": "^4.2.21", "@types/glob": "^7.1.4", "@types/mocha": "^9.0.0", @@ -70,8 +69,11 @@ "run": "ts-node typescript-json-schema-cli.ts", "build": "tsc", "lint": "tslint --project tsconfig.json -c tslint.json --exclude '**/*.d.ts'", + "lint:schemas": "find test/programs -name '*.json' -exec npx @sourcemeta/jsonschema lint {} \\;", + "fix:schemas": "find test/programs -name '*.json' -exec npx @sourcemeta/jsonschema lint --fix {} \\;", "style": "prettier --write *.js *.ts test/*.ts", "dev": "tsc -w", "test:dev": "mocha -t 5000 --watch --require source-map-support/register dist/test" - } + }, + "packageManager": "yarn@4.10.2" } diff --git a/test/lint.test.ts b/test/lint.test.ts new file mode 100644 index 00000000..ee8f93cf --- /dev/null +++ b/test/lint.test.ts @@ -0,0 +1,37 @@ +import { assert } from "chai"; +import { exec, getDefaultArgs } from "../typescript-json-schema"; +import * as fs from "fs"; + +describe("schema linting", () => { + const testSchemaPath = "./test-lint-output.json"; + + afterEach(() => { + try { + if (fs.existsSync(testSchemaPath)) { + fs.unlinkSync(testSchemaPath); + } + } catch (error) { + } + }); + + it("should generate schema with linting", async () => { + const args = { + ...getDefaultArgs(), + out: testSchemaPath, + lint: true, + fix: false + }; + + try { + await exec("test/programs/interface-single/main.ts", "MyObject", args); + assert.isTrue(fs.existsSync(testSchemaPath), "Schema file should be generated"); + } catch (error: any) { + if (error.message.includes("jsonschema")) { + console.warn("Skipping linting test: CLI not available"); + assert.isTrue(true, "Test skipped"); + } else { + throw error; + } + } + }); +}); diff --git a/typescript-json-schema-cli.ts b/typescript-json-schema-cli.ts index c1bb17ba..edd674f4 100644 --- a/typescript-json-schema-cli.ts +++ b/typescript-json-schema-cli.ts @@ -57,6 +57,12 @@ export function run() { .describe("tsNodeRegister", "Use ts-node/register (needed for requiring typescript files).") .boolean("constAsEnum").default("constAsEnum", defaultArgs.constAsEnum) .describe("constAsEnum", "Use enums with a single value when declaring constants. Needed for OpenAPI compatibility") + .boolean("lint").default("lint", defaultArgs.lint) + .describe("lint", "Lint generated schemas for JSON Schema best practices and report issues") + .boolean("fix").default("fix", defaultArgs.fix) + .describe("fix", "Automatically fix linting issues in generated schemas") + .boolean("lintStrict").default("lintStrict", defaultArgs.lintStrict) + .describe("lintStrict", "Enable strict linting rules (use with --fix to apply strict fixes)") .argv; exec(args._[0], args._[1], { @@ -84,6 +90,9 @@ export function run() { defaultNumberType: args.defaultNumberType, tsNodeRegister: args.tsNodeRegister, constAsEnum: args.constAsEnum, + lint: args.lint, + fix: args.fix, + lintStrict: args.lintStrict, }); } diff --git a/typescript-json-schema.ts b/typescript-json-schema.ts index f2730b86..6bc35fe8 100644 --- a/typescript-json-schema.ts +++ b/typescript-json-schema.ts @@ -5,6 +5,9 @@ import { createHash } from "crypto"; import * as ts from "typescript"; import { JSONSchema7, JSONSchema7TypeName } from "json-schema"; import { pathEqual } from "path-equal"; +import { execSync } from "child_process"; +import * as fs from "fs"; +import * as os from "os"; export { Program, CompilerOptions, Symbol } from "typescript"; const vm = require("vm"); @@ -61,6 +64,9 @@ export function getDefaultArgs(): Args { defaultNumberType: "number", tsNodeRegister: false, constAsEnum: false, + lint: false, + fix: false, + lintStrict: false, }; } @@ -93,6 +99,9 @@ export type Args = { defaultNumberType: "number" | "integer"; tsNodeRegister: boolean; constAsEnum: boolean; + lint: boolean; + fix: boolean; + lintStrict: boolean; }; export type PartialArgs = Partial; @@ -1828,6 +1837,73 @@ function normalizeFileName(fn: string): string { return fn; } +async function lintSchema(schemaJson: string, options: { fix?: boolean; strict?: boolean } = {}): Promise { + const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsonschema-lint-')); + const tempFile = path.join(tempDir, 'schema.json'); + + try { + fs.writeFileSync(tempFile, schemaJson); + + const jsonschemaCmd = path.join(process.cwd(), 'node_modules/.bin/jsonschema'); + let cmd = `"${jsonschemaCmd}" lint "${tempFile}"`; + + if (options.fix) { + cmd += ' --fix'; + } + + if (options.strict) { + cmd += ' --strict'; + } + + try { + const result = execSync(cmd, { + stdio: 'pipe', + encoding: 'utf8' + }); + + if (!options.fix && result) { + console.log('JSON Schema lint results:'); + console.log(result); + } else if (options.fix) { + console.log('JSON Schema auto-fix completed successfully.'); + if (result) { + console.log(result); + } + } + + } catch (error: any) { + if (error.status === 1) { + const output = error.stdout || error.stderr || ''; + + if (!options.fix) { + console.error('JSON Schema linting issues found:'); + console.error(output); + console.log('Run with --fix to automatically fix these issues.'); + } else { + console.log('JSON Schema linting issues were found and fixed:'); + if (output) { + console.log(output); + } + } + } else { + throw new Error(`JSON Schema linting failed: ${error.message}`); + } + } + + const lintedSchema = fs.readFileSync(tempFile, 'utf8'); + return lintedSchema; + + } catch (error: any) { + throw new Error(`Failed to lint schema: ${error.message}`); + } finally { + try { + fs.unlinkSync(tempFile); + fs.rmdirSync(tempDir); + } catch (error) { + } + } +} + export async function exec(filePattern: string, fullTypeName: string, args = getDefaultArgs()): Promise { let program: ts.Program; let onlyIncludeFiles: string[] | undefined = undefined; @@ -1854,15 +1930,32 @@ export async function exec(filePattern: string, fullTypeName: string, args = get throw new Error("No output definition. Probably caused by errors prior to this?"); } - const json = stringify(definition, null, 4) + "\n\n"; + let json = stringify(definition, null, 4) + "\n\n"; + + if (args.lint || args.fix) { + try { + json = await lintSchema(json, { + fix: args.fix, + strict: args.lintStrict + }); + } catch (error: any) { + if (args.ignoreErrors) { + console.warn('Schema linting failed:', error.message); + console.warn('Proceeding with original schema due to ignoreErrors flag...'); + } else { + throw error; + } + } + } + if (args.out) { return new Promise((resolve, reject) => { - const fs = require("fs"); - fs.mkdir(path.dirname(args.out), { recursive: true }, function (mkErr: Error) { + const fsModule = require("fs"); + fsModule.mkdir(path.dirname(args.out), { recursive: true }, function (mkErr: Error) { if (mkErr) { return reject(new Error("Unable to create parent directory for output file: " + mkErr.message)); } - fs.writeFile(args.out, json, function (wrErr: Error) { + fsModule.writeFile(args.out, json, function (wrErr: Error) { if (wrErr) { return reject(new Error("Unable to write output file: " + wrErr.message)); } diff --git a/yarn.lock b/yarn.lock index c08d754d..ada6da12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,20 +4,14 @@ "@babel/code-frame@^7.0.0": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== dependencies: "@babel/highlight" "^7.14.5" "@babel/helper-validator-identifier@^7.14.5": version "7.14.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== "@babel/highlight@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== dependencies: "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" @@ -25,115 +19,75 @@ "@cspotcode/source-map-support@^0.8.0": version "0.8.1" - resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@sourcemeta/jsonschema@^11.8.2": + version "11.8.2" + "@tsconfig/node10@^1.0.7": version "1.0.8" - resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== "@tsconfig/node12@^1.0.7": version "1.0.9" - resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== "@tsconfig/node14@^1.0.0": version "1.0.1" - resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== "@tsconfig/node16@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== "@types/chai@^4.2.21": version "4.2.21" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.21.tgz" - integrity sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg== "@types/glob@^7.1.4": version "7.1.4" - resolved "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz" - integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== dependencies: "@types/minimatch" "*" "@types/node" "*" "@types/json-schema@^7.0.9": version "7.0.9" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== "@types/minimatch@*": version "3.0.5" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz" - integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/mocha@^9.0.0": version "9.0.0" - resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz" - integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== - -"@types/node@*": - version "16.18.13" - resolved "https://registry.npmjs.org/@types/node/-/node-16.18.13.tgz" - integrity sha512-l0/3XZ153UTlNOnZK8xSNoJlQda9/WnYgiTdcKKPJSZjdjI9MU+A9oMXOesAWLSnqAaaJhj3qfQsU07Dr8OUwg== -"@types/node@^18.11.9": +"@types/node@*", "@types/node@^18.11.9": version "18.19.43" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.43.tgz#fe01bb599b60bb3279c26d0fdb751d2f3e299ae0" - integrity sha512-Mw/YlgXnyJdEwLoFv2dpuJaDFriX+Pc+0qOBJ57jC1H6cDxIj2xc5yUrdtArDVG0m+KV6622a4p2tenEqB3C/g== dependencies: undici-types "~5.26.4" "@ungap/promise-all-settled@1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== acorn-walk@^8.1.1: version "8.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.4.1: version "8.5.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== ajv-formats@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" - integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== dependencies: ajv "^8.0.0" ajv@^8.0.0, ajv@^8.6.3: version "8.6.3" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -142,119 +96,82 @@ ajv@^8.0.0, ajv@^8.6.3: ansi-colors@4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-regex@^5.0.0: +ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" anymatch@~3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" arg@^4.1.0: version "4.1.3" - resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== argparse@^1.0.7: version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argparse@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== assertion-error@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== binary-extensions@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" braces@~3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" browser-stdout@1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== builtin-modules@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.3.0" chai@^4.3.4: - version "4.3.4" - resolved "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + version "4.5.0" dependencies: assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" pathval "^1.1.1" - type-detect "^4.0.5" + type-detect "^4.1.0" chalk@^2.0.0, chalk@^2.3.0: version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -262,21 +179,17 @@ chalk@^2.0.0, chalk@^2.3.0: chalk@^4.1.0: version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= +check-error@^1.0.3: + version "1.0.3" + dependencies: + get-func-name "^2.0.2" -chokidar@3.5.2: - version "3.5.2" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== +chokidar@3.5.3: + version "3.5.3" dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -290,167 +203,123 @@ chokidar@3.5.2: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + color-convert@^1.9.0: version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - color-name@~1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-name@1.1.3: + version "1.1.3" commander@^2.12.1: version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== concat-map@0.0.1: version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= create-require@^1.1.0: version "1.1.1" - resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -debug@4.3.2: - version "4.3.2" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== +debug@4.3.3: + version "4.3.3" dependencies: ms "2.1.2" decamelize@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== +deep-eql@^4.1.3: + version "4.1.4" dependencies: type-detect "^4.0.0" -diff@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - diff@^4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +diff@5.0.0: + version "5.0.0" emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + version "3.2.0" escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escape-string-regexp@4.0.0: + version "4.0.0" esprima@^4.0.0: version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== fast-deep-equal@^3.1.1: version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + version "7.1.1" dependencies: to-regex-range "^5.0.1" find-up@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" path-exists "^4.0.0" flat@^5.0.2: version "5.0.2" - resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= +get-func-name@^2.0.1, get-func-name@^2.0.2: + version "2.0.2" glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@7.1.7, glob@^7.1.1, glob@^7.1.7: - version "7.1.7" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== +glob@^7.1.1, glob@^7.1.7: + version "7.2.3" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.2.0: + version "7.2.0" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -461,395 +330,285 @@ glob@7.1.7, glob@^7.1.1, glob@^7.1.7: growl@1.10.5: version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== has-flag@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-flag@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.2: + version "2.0.2" dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" he@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== inflight@^1.0.4: version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2: version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" -is-core-module@^2.2.0: - version "2.6.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== +is-core-module@^2.16.0: + version "2.16.1" dependencies: - has "^1.0.3" + hasown "^2.0.2" is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" dependencies: is-extglob "^2.1.1" is-number@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-plain-obj@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-unicode-supported@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== isexe@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= js-tokens@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" js-yaml@^3.13.1: version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@4.1.0: + version "4.1.0" + dependencies: + argparse "^2.0.1" + json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== locate-path@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" log-symbols@4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" is-unicode-supported "^0.1.0" +loupe@^2.3.6: + version "2.3.7" + dependencies: + get-func-name "^2.0.1" + make-error@^1.1.1: version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimatch@4.2.1: + version "4.2.1" + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.6: + version "1.2.8" mkdirp@^0.5.3: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + version "0.5.6" dependencies: - minimist "^1.2.5" + minimist "^1.2.6" mocha@^9.1.3: - version "9.1.3" - resolved "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz" - integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + version "9.2.2" dependencies: "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" - chokidar "3.5.2" - debug "4.3.2" + chokidar "3.5.3" + debug "4.3.3" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" - glob "7.1.7" + glob "7.2.0" growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" - minimatch "3.0.4" + minimatch "4.2.1" ms "2.1.3" - nanoid "3.1.25" + nanoid "3.3.1" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" which "2.0.2" - workerpool "6.1.5" + workerpool "6.2.0" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" ms@2.1.2: version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== ms@2.1.3: version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@3.1.25: - version "3.1.25" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz" - integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== +nanoid@3.3.1: + version "3.3.1" normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== once@^1.3.0: version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" p-limit@^3.0.2: version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" path-equal@^1.2.5: version "1.2.5" - resolved "https://registry.yarnpkg.com/path-equal/-/path-equal-1.2.5.tgz#9fcbdd5e5daee448e96f43f3bac06c666b5e982a" - integrity sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-parse@^1.0.6: +path-parse@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== pathval@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.0" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + version "2.3.1" prettier@^2.4.1: - version "2.4.1" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== + version "2.8.8" punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + version "2.3.1" randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== resolve@^1.3.2: - version "1.20.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + version "1.22.10" dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" + is-core-module "^2.16.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" safe-buffer@^5.1.0: version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-stable-stringify@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.2.0.tgz" - integrity sha512-C6AuMdYPuPV/P1leplHNu0lgc2LAElq/g3TdoksDCIVtBhr78o/CH03bt/9SKqugFbKU9CUjsNlCu0fjtQzQUw== + version "2.5.0" semver@^5.3.0: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" serialize-javascript@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" source-map-support@^0.5.20: - version "0.5.20" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map@^0.6.0: version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== sprintf-js@~1.0.2: version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" strip-json-comments@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@8.1.1: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" supports-color@^5.3.0: version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.1.0: version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" +supports-color@8.1.1: + version "8.1.1" + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" ts-node@^10.9.1: - version "10.9.1" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + version "10.9.2" dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" @@ -867,13 +626,9 @@ ts-node@^10.9.1: tslib@^1.13.0, tslib@^1.8.1: version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tslint@^6.1.3: version "6.1.3" - resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" - integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" @@ -891,54 +646,36 @@ tslint@^6.1.3: tsutils@^2.29.0: version "2.29.0" - resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== dependencies: tslib "^1.8.1" -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-detect@^4.0.0, type-detect@^4.1.0: + version "4.1.0" -typescript@~5.5.0: +"typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev", "typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev", typescript@>=2.7, typescript@~5.5.0: version "5.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" - integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== undici-types@~5.26.4: version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== uri-js@^4.2.2: version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" v8-compile-cache-lib@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== which@2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -workerpool@6.1.5: - version "6.1.5" - resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz" - integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== +workerpool@6.2.0: + version "6.2.0" wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" @@ -946,46 +683,37 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yargs-parser@20.2.4, yargs-parser@^20.2.2: +yargs-parser@^20.2.2, yargs-parser@20.2.4: version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^21.1.1: + version "21.1.1" yargs-unparser@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" decamelize "^4.0.0" flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== +yargs@^17.1.1: + version "17.7.2" dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.1.1" -yargs@^17.1.1: - version "17.1.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz" - integrity sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ== +yargs@16.2.0: + version "16.2.0" dependencies: cliui "^7.0.2" escalade "^3.1.1" @@ -997,10 +725,6 @@ yargs@^17.1.1: yn@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 735082aacf8365dd1b01d6daf8f2245597b34afc Mon Sep 17 00:00:00 2001 From: karan-palan Date: Mon, 22 Sep 2025 12:24:20 +0530 Subject: [PATCH 2/3] chore(linting): warn instead of empty catch block Signed-off-by: karan-palan --- test/lint.test.ts | 1 + test/schema.test.ts | 42 ++++++++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/test/lint.test.ts b/test/lint.test.ts index ee8f93cf..d72a927d 100644 --- a/test/lint.test.ts +++ b/test/lint.test.ts @@ -11,6 +11,7 @@ describe("schema linting", () => { fs.unlinkSync(testSchemaPath); } } catch (error) { + console.warn(`Warning: Failed to clean up test file: ${error instanceof Error ? error.message : error}`); } }); diff --git a/test/schema.test.ts b/test/schema.test.ts index 3effcb16..caf261af 100644 --- a/test/schema.test.ts +++ b/test/schema.test.ts @@ -120,7 +120,7 @@ export function assertRejection( type: string, settings: TJS.PartialArgs = {}, compilerOptions?: TJS.CompilerOptions, - errType?: RegExp | ErrorConstructor, + errType?: RegExp | ErrorConstructor ) { it(group + " should reject input", () => { let schema = null; @@ -181,8 +181,8 @@ describe("interfaces", () => { const schema = generator?.getSchemaForSymbol("MySubObject"); // Should not change original schema object. - assert.deepEqual(schemaOverride1, { type: "string" }); - assert.deepEqual(schemaOverride2, { type: "integer" }); + assert.deepEqual(schemaOverride1, { type: "string" }); + assert.deepEqual(schemaOverride2, { type: "integer" }); assert.deepEqual(schema, { ...schemaOverride1, $schema: "http://json-schema.org/draft-07/schema#" }); }); @@ -198,20 +198,20 @@ describe("interfaces", () => { const schema = generator?.getSchemaForSymbol("MySubObject1", true, true); // Should not change original schema object. - assert.deepEqual(schemaOverride1, { type: "string" }); - assert.deepEqual(schemaOverride2, { type: "integer" }); + assert.deepEqual(schemaOverride1, { type: "string" }); + assert.deepEqual(schemaOverride2, { type: "integer" }); assert.deepEqual(schema, { ...schemaOverride1, $schema: "http://json-schema.org/draft-07/schema#", definitions: { MySubObject1: { - type: "string" + type: "string", }, MySubObject2: { - type: "integer" - } - } + type: "integer", + }, + }, }); }); it("should ignore type aliases that have schema overrides", () => { @@ -475,7 +475,13 @@ describe("schema", () => { assertSchema("undefined-property", "MyObject"); // Creating a schema for main type = undefined should fail - assertRejection("type-alias-undefined", "MyUndefined", undefined, undefined, /Not supported: root type undefined/); + assertRejection( + "type-alias-undefined", + "MyUndefined", + undefined, + undefined, + /Not supported: root type undefined/ + ); }); describe("other", () => { @@ -573,13 +579,17 @@ describe("when reusing a generator", () => { const program = TJS.programFromConfig(resolve(testProgramPath + "tsconfig.json")); const generator = TJS.buildGenerator(program); - ["MyObject", "MyOtherObject"].forEach(symbolName => { + ["MyObject", "MyOtherObject"].forEach((symbolName) => { const expectedSchemaString = readFileSync(testProgramPath + `schema.${symbolName}.json`, "utf8"); const expectedSchemaObject = JSON.parse(expectedSchemaString); const actualSchemaObject = generator?.getSchemaForSymbol(symbolName); - assert.deepEqual(actualSchemaObject, expectedSchemaObject, `The schema for ${symbolName} is not as expected`); + assert.deepEqual( + actualSchemaObject, + expectedSchemaObject, + `The schema for ${symbolName} is not as expected` + ); }); }); @@ -600,7 +610,11 @@ describe("when reusing a generator", () => { const actualSchemaObject = generator?.getSchemaForSymbol(symbolName); - assert.deepEqual(actualSchemaObject, expectedSchemaObject, `The schema for ${symbolName} is not as expected`); + assert.deepEqual( + actualSchemaObject, + expectedSchemaObject, + `The schema for ${symbolName} is not as expected` + ); }); }); @@ -621,7 +635,7 @@ describe("when reusing a generator", () => { }); }); -describe("satisfies keyword - ignore from a \"satisfies\" and build by rally type", () => { +describe('satisfies keyword - ignore from a "satisfies" and build by rally type', () => { assertSchema("satisfies-keyword", "Specific"); }); From 435d38934d04906b2452bf55bf65421cf1fca057 Mon Sep 17 00:00:00 2001 From: karan-palan Date: Mon, 22 Sep 2025 12:30:40 +0530 Subject: [PATCH 3/3] style: format and lint Signed-off-by: karan-palan --- test/lint.test.ts | 4 +- typescript-json-schema.ts | 178 +++++++++++++++++++++++--------------- 2 files changed, 111 insertions(+), 71 deletions(-) diff --git a/test/lint.test.ts b/test/lint.test.ts index d72a927d..b4e0b99e 100644 --- a/test/lint.test.ts +++ b/test/lint.test.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; describe("schema linting", () => { const testSchemaPath = "./test-lint-output.json"; - + afterEach(() => { try { if (fs.existsSync(testSchemaPath)) { @@ -20,7 +20,7 @@ describe("schema linting", () => { ...getDefaultArgs(), out: testSchemaPath, lint: true, - fix: false + fix: false, }; try { diff --git a/typescript-json-schema.ts b/typescript-json-schema.ts index 6bc35fe8..27f0447a 100644 --- a/typescript-json-schema.ts +++ b/typescript-json-schema.ts @@ -565,7 +565,11 @@ export class JsonSchemaGenerator { /** * Parse the comments of a symbol into the definition and other annotations. */ - private parseCommentsIntoDefinition(symbol: ts.Symbol, definition: Definition, otherAnnotations: Record): void { + private parseCommentsIntoDefinition( + symbol: ts.Symbol, + definition: Definition, + otherAnnotations: Record + ): void { if (!symbol) { return; } @@ -588,7 +592,8 @@ export class JsonSchemaGenerator { return newlineNormalizedComment; }) - .join("").trim(); + .join("") + .trim(); } } @@ -628,7 +633,10 @@ export class JsonSchemaGenerator { if (match) { const k = match[1]; const v = match[2]; - (definition as DefinitionIndex)[name] = { ...(definition as Record>)[name], [k]: v ? parseValue(symbol, k, v) : true }; + (definition as DefinitionIndex)[name] = { + ...(definition as Record>)[name], + [k]: v ? parseValue(symbol, k, v) : true, + }; return; } } @@ -639,7 +647,7 @@ export class JsonSchemaGenerator { const key = parts[0] as keyof Definition; if (parts.length === 2 && subDefinitions[key]) { (definition as DefinitionIndex)[key] = { - ...definition[key] as Record, + ...(definition[key] as Record), [parts[1]]: text ? parseValue(symbol, name, text) : true, }; } @@ -659,7 +667,7 @@ export class JsonSchemaGenerator { reffedType: ts.Symbol, definition: Definition, defaultNumberType = this.args.defaultNumberType, - ignoreUndefined = false, + ignoreUndefined = false ): Definition { const tupleType = resolveTupleType(propertyType); @@ -757,20 +765,24 @@ export class JsonSchemaGenerator { if ( propertyType.flags & ts.TypeFlags.Object && (propertyType as ts.ObjectType).objectFlags & - (ts.ObjectFlags.Anonymous | ts.ObjectFlags.Interface | ts.ObjectFlags.Mapped) + (ts.ObjectFlags.Anonymous | ts.ObjectFlags.Interface | ts.ObjectFlags.Mapped) ) { definition.type = "object"; definition.additionalProperties = false; definition.patternProperties = { [NUMERIC_INDEX_PATTERN]: this.getTypeDefinition(arrayType), }; - if (!!Array.from((propertyType).members)?.find((member: [string]) => member[0] !== "__index")) { + if ( + !!Array.from((propertyType).members)?.find( + (member: [string]) => member[0] !== "__index" + ) + ) { this.getClassDefinition(propertyType, definition); } } else if (propertyType.flags & ts.TypeFlags.TemplateLiteral) { definition.type = "string"; // @ts-ignore - const {texts, types} = propertyType; + const { texts, types } = propertyType; const pattern = []; for (let i = 0; i < texts.length; i++) { const text = texts[i].replace(/[\\^$.*+?()[\]{}|]/g, "\\$&"); @@ -785,8 +797,7 @@ export class JsonSchemaGenerator { pattern.push(`${text}.*`); } - if (type.flags & ts.TypeFlags.Number - || type.flags & ts.TypeFlags.BigInt) { + if (type.flags & ts.TypeFlags.Number || type.flags & ts.TypeFlags.BigInt) { pattern.push(`${text}[0-9]*`); } @@ -799,7 +810,6 @@ export class JsonSchemaGenerator { } } - if (i === texts.length - 1) { pattern.push(`${text}$`); } @@ -992,8 +1002,17 @@ export class JsonSchemaGenerator { pushEnumValue(value); } else { const symbol = valueType.aliasSymbol; - const def = this.getTypeDefinition(valueType, undefined, undefined, symbol, symbol, undefined, undefined, true); - if (def.type === "undefined" as any) { + const def = this.getTypeDefinition( + valueType, + undefined, + undefined, + symbol, + symbol, + undefined, + undefined, + true + ); + if (def.type === ("undefined" as any)) { continue; } const keys = Object.keys(def); @@ -1020,7 +1039,8 @@ export class JsonSchemaGenerator { if (isOnlyBooleans) { pushSimpleType("boolean"); } else { - const enumSchema: Definition = enumValues.length > 1 ? { enum: enumValues.sort() } : { const: enumValues[0] }; + const enumSchema: Definition = + enumValues.length > 1 ? { enum: enumValues.sort() } : { const: enumValues[0] }; // If all values are of the same primitive type, add a "type" field to the schema if ( @@ -1163,7 +1183,8 @@ export class JsonSchemaGenerator { } const indexSymbol: ts.Symbol = (indexSignature.parameters[0]).symbol; const indexType = this.tc.getTypeOfSymbolAtLocation(indexSymbol, node); - const isIndexedObject = indexType.flags === ts.TypeFlags.String || indexType.flags === ts.TypeFlags.Number; + const isIndexedObject = + indexType.flags === ts.TypeFlags.String || indexType.flags === ts.TypeFlags.Number; if (indexType.flags !== ts.TypeFlags.Number && !isIndexedObject) { throw new Error( "Not supported: IndexSignatureDeclaration with index symbol other than a number or a string" @@ -1240,7 +1261,8 @@ export class JsonSchemaGenerator { const requiredProps = props.reduce((required: string[], prop: ts.Symbol) => { const def = {}; this.parseCommentsIntoDefinition(prop, def, {}); - const allUnionTypesFlags: number[] = (prop).links?.type?.types?.map?.((t: any) => t.flags) || []; + const allUnionTypesFlags: number[] = + (prop).links?.type?.types?.map?.((t: any) => t.flags) || []; if ( !(prop.flags & ts.SymbolFlags.Optional) && !(prop.flags & ts.SymbolFlags.Method) && @@ -1307,7 +1329,7 @@ export class JsonSchemaGenerator { reffedType?: ts.Symbol, pairedSymbol?: ts.Symbol, forceNotRef: boolean = false, - ignoreUndefined = false, + ignoreUndefined = false ): Definition { const definition: Definition = {}; // real definition @@ -1474,7 +1496,15 @@ export class JsonSchemaGenerator { const types = (typ).types; for (const member of types) { - const other = this.getTypeDefinition(member, false, undefined, undefined, undefined, undefined, true); + const other = this.getTypeDefinition( + member, + false, + undefined, + undefined, + undefined, + undefined, + true + ); definition.type = other.type; // should always be object definition.properties = { ...definition.properties, @@ -1520,12 +1550,15 @@ export class JsonSchemaGenerator { this.recursiveTypeRef.delete(fullTypeName); // If the type was recursive (there is reffedDefinitions) - lets replace it to reference if (this.reffedDefinitions[fullTypeName]) { - const annotations = Object.entries(returnedDefinition).reduce>((acc, [key, value]) => { - if (annotationKeywords[key as keyof typeof annotationKeywords] && typeof value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); + const annotations = Object.entries(returnedDefinition).reduce>( + (acc, [key, value]) => { + if (annotationKeywords[key as keyof typeof annotationKeywords] && typeof value !== undefined) { + acc[key] = value; + } + return acc; + }, + {} + ); returnedDefinition = { $ref: `${this.args.id}#/definitions/` + fullTypeName, @@ -1545,7 +1578,11 @@ export class JsonSchemaGenerator { this.schemaOverrides.set(symbolName, schema); } - public getSchemaForSymbol(symbolName: string, includeReffedDefinitions: boolean = true, includeAllOverrides: boolean = false): Definition { + public getSchemaForSymbol( + symbolName: string, + includeReffedDefinitions: boolean = true, + includeAllOverrides: boolean = false + ): Definition { const overrideDefinition = this.schemaOverrides.get(symbolName); if (!this.allSymbols[symbolName] && !overrideDefinition) { throw new Error(`type ${symbolName} not found`); @@ -1557,14 +1594,16 @@ export class JsonSchemaGenerator { if (overrideDefinition) { def = { ...overrideDefinition }; } else { - def = overrideDefinition ? overrideDefinition : this.getTypeDefinition( - this.allSymbols[symbolName], - this.args.topRef, - undefined, - undefined, - undefined, - this.userSymbols[symbolName] || undefined - ); + def = overrideDefinition + ? overrideDefinition + : this.getTypeDefinition( + this.allSymbols[symbolName], + this.args.topRef, + undefined, + undefined, + undefined, + this.userSymbols[symbolName] || undefined + ); } if (this.args.ref && includeReffedDefinitions && Object.keys(this.reffedDefinitions).length > 0) { @@ -1578,11 +1617,15 @@ export class JsonSchemaGenerator { return def; } - public getSchemaForSymbols(symbolNames: string[], includeReffedDefinitions: boolean = true, includeAllOverrides: boolean = false): Definition { + public getSchemaForSymbols( + symbolNames: string[], + includeReffedDefinitions: boolean = true, + includeAllOverrides: boolean = false + ): Definition { const root: { - $id?: string, - $schema: string, - definitions: Record + $id?: string; + $schema: string; + definitions: Record; } = { $schema: "http://json-schema.org/draft-07/schema#", definitions: {}, @@ -1838,49 +1881,48 @@ function normalizeFileName(fn: string): string { } async function lintSchema(schemaJson: string, options: { fix?: boolean; strict?: boolean } = {}): Promise { - const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsonschema-lint-')); - const tempFile = path.join(tempDir, 'schema.json'); - + const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "jsonschema-lint-")); + const tempFile = path.join(tempDir, "schema.json"); + try { fs.writeFileSync(tempFile, schemaJson); - - const jsonschemaCmd = path.join(process.cwd(), 'node_modules/.bin/jsonschema'); + + const jsonschemaCmd = path.join(process.cwd(), "node_modules/.bin/jsonschema"); let cmd = `"${jsonschemaCmd}" lint "${tempFile}"`; - + if (options.fix) { - cmd += ' --fix'; + cmd += " --fix"; } - + if (options.strict) { - cmd += ' --strict'; + cmd += " --strict"; } - + try { - const result = execSync(cmd, { - stdio: 'pipe', - encoding: 'utf8' + const result = execSync(cmd, { + stdio: "pipe", + encoding: "utf8", }); - + if (!options.fix && result) { - console.log('JSON Schema lint results:'); + console.log("JSON Schema lint results:"); console.log(result); } else if (options.fix) { - console.log('JSON Schema auto-fix completed successfully.'); + console.log("JSON Schema auto-fix completed successfully."); if (result) { console.log(result); } } - } catch (error: any) { if (error.status === 1) { - const output = error.stdout || error.stderr || ''; - + const output = error.stdout || error.stderr || ""; + if (!options.fix) { - console.error('JSON Schema linting issues found:'); + console.error("JSON Schema linting issues found:"); console.error(output); - console.log('Run with --fix to automatically fix these issues.'); + console.log("Run with --fix to automatically fix these issues."); } else { - console.log('JSON Schema linting issues were found and fixed:'); + console.log("JSON Schema linting issues were found and fixed:"); if (output) { console.log(output); } @@ -1889,18 +1931,16 @@ async function lintSchema(schemaJson: string, options: { fix?: boolean; strict?: throw new Error(`JSON Schema linting failed: ${error.message}`); } } - - const lintedSchema = fs.readFileSync(tempFile, 'utf8'); + + const lintedSchema = fs.readFileSync(tempFile, "utf8"); return lintedSchema; - } catch (error: any) { throw new Error(`Failed to lint schema: ${error.message}`); } finally { try { fs.unlinkSync(tempFile); fs.rmdirSync(tempDir); - } catch (error) { - } + } catch (error) {} } } @@ -1931,23 +1971,23 @@ export async function exec(filePattern: string, fullTypeName: string, args = get } let json = stringify(definition, null, 4) + "\n\n"; - + if (args.lint || args.fix) { try { json = await lintSchema(json, { fix: args.fix, - strict: args.lintStrict + strict: args.lintStrict, }); } catch (error: any) { if (args.ignoreErrors) { - console.warn('Schema linting failed:', error.message); - console.warn('Proceeding with original schema due to ignoreErrors flag...'); + console.warn("Schema linting failed:", error.message); + console.warn("Proceeding with original schema due to ignoreErrors flag..."); } else { throw error; } } } - + if (args.out) { return new Promise((resolve, reject) => { const fsModule = require("fs");