diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a769cbe3..0e6113e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,8 +10,8 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 - run: yarn --frozen-lockfile - name: Lint run: yarn lint diff --git a/README.md b/README.md index f757a833..1707e43b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/typescript-json-schema.svg)](https://www.npmjs.com/package/typescript-json-schema) ![Test](https://github.com/YousefED/typescript-json-schema/workflows/Test/badge.svg) -Generate json-schemas from your Typescript sources. +Generate json-schemas from your Typescript sources. This library is lightweight and more or less in maintenance mode. For a more complete JSON schema generator, take a look at [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator). ## Features @@ -51,6 +51,9 @@ Options: --id Set schema id. [string] [default: ""] --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] + --experimentalDecorators Use experimentalDecorators when loading typescript modules. + [boolean] [default: true] ``` ### Programmatic use diff --git a/api.md b/api.md index 86f81567..7e863391 100644 --- a/api.md +++ b/api.md @@ -230,13 +230,20 @@ interface MySubObject { a: boolean; } +interface AnotherSubObject { + b: boolean; +} + interface MyObject { /** * @title empty# */ empty; - + /** + * @title filled + */ filled: MySubObject; + nonTitled: AnotherSubObject; } ``` @@ -485,6 +492,21 @@ interface MyObject { ``` +## [comments-comment](./test/programs/comments-comment) + +```ts +/** + * @$comment Object comment + */ +interface MyObject { + /** + * @$comment Property comment + */ + text: string; +} +``` + + ## [comments-from-lib](./test/programs/comments-from-lib) ```ts @@ -600,6 +622,25 @@ export interface MyObject { ``` +## [const-as-enum](./test/programs/const-as-enum) + +```ts +export interface MyObject { + reference: true; +} +``` + + +## [const-keyword](./test/programs/const-keyword) + +```ts +const fn = (value: T) => + ({ value }); + +export type Object = ReturnType>; +``` + + ## [custom-dates](./test/programs/custom-dates) ```ts @@ -1032,6 +1073,68 @@ export interface MyObject { ``` +## [key-in-key-of-multi](./test/programs/key-in-key-of-multi) + +```ts +type Util = { + utilKey1: { + utilDeepKey11: string; + utilDeepKey12: number; + }; + utilKey2: { + utilDeepKey21: boolean; + utilDeepKey22: null; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; +``` + + +## [key-in-key-of-multi-underscores](./test/programs/key-in-key-of-multi-underscores) + +```ts +type Util = { + __2Underscores: { + utilDeepKey2: string; + }; + ___3Underscores: { + utilDeepKey3: string; + }; + ____4Underscores: { + utilDeepKey4: string; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; +``` + + +## [key-in-key-of-single](./test/programs/key-in-key-of-single) + +```ts +type Util = { + utilKey: { + utilDeepKey: string; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; +``` + + ## [map-types](./test/programs/map-types) ```ts @@ -1170,6 +1273,21 @@ export interface Never { ``` +## [no-ref](./test/programs/no-ref) + +```ts +type MySubType = { + id: string; +}; + +export type MyModule = { + address: MySubType & { extraProp: number }; + address2: MySubType; + address3: MySubType; +}; +``` + + ## [no-unrelated-definitions](./test/programs/no-unrelated-definitions) ```ts @@ -1191,6 +1309,17 @@ interface SomeOtherDefinition { ``` +## [numeric-keys-and-others](./test/programs/numeric-keys-and-others) + +```ts +interface NumericKeysAndOthers { + [key: number]: number; + a: string; + b: boolean; +} +``` + + ## [object-numeric-index](./test/programs/object-numeric-index) ```ts @@ -1280,6 +1409,26 @@ export class ObjectId {} ``` +## [satisfies-keyword](./test/programs/satisfies-keyword) + +```ts +interface Basic { + a: string; + b: number; + c: boolean; +} + +const myObject = { + a: "a" as const, + b: 1 as const, + c: true as const, +// tslint:disable-next-line:variable-name +} satisfies Basic; + +export type Specific = typeof myObject; +``` + + ## [strict-null-checks](./test/programs/strict-null-checks) ```ts @@ -1320,6 +1469,33 @@ class MyObject { ``` +## [string-template-literal](./test/programs/string-template-literal) + +```ts +interface MyObject { + a: `@${string}`, + b: `@${number}`, + c: `@${bigint}`, + d: `@${boolean}`, + e: `@${undefined}`, + f: `@${null}`, + g: `${string}@`, + h: `${number}@`, + i: `${string}@${number}`, + j: `${string}.${string}`, +} +``` + + +## [symbol](./test/programs/symbol) + +```ts +export type MyObject = { + a: symbol; +}; +``` + + ## [tsconfig](./test/programs/tsconfig) ```ts @@ -1353,6 +1529,13 @@ export interface IncludedOnlyByTsConfig { ``` +## [type-alias-never](./test/programs/type-alias-never) + +```ts +export type MyNever = never; +``` + + ## [type-alias-or](./test/programs/type-alias-or) ```ts @@ -1400,6 +1583,13 @@ type MyString = string; ``` +## [type-alias-undefined](./test/programs/type-alias-undefined) + +```ts +export type MyUndefined = undefined; +``` + + ## [type-aliases](./test/programs/type-aliases) ```ts @@ -1764,8 +1954,37 @@ interface ChildFoo { } interface Foo { - readonly childFoos: Foo & ChildFoo; + readonly childFoos: Foo | ChildFoo; +} +``` + + +## [type-intersection-recursive-no-additional](./test/programs/type-intersection-recursive-no-additional) + +```ts +type MyRecursiveNode = { + next?: MyNode; } + +type MyNode = { + val: string; +} & MyRecursiveNode; + +type MyLinkedList = MyNode; +``` + + +## [type-literals](./test/programs/type-literals) + +```ts +type MyObject = { + param1: "1" | "2" | "3"; + param2: "1" | "2" | 3 | true; + /** @enum {string} */ + param3: "1" | "2" | "3"; + /** @enum {unknown} */ + param4: "1" | "2" | 3 | true; +}; ``` @@ -1894,6 +2113,34 @@ interface MyObject { ``` +## [type-union-strict-null-keep-description](./test/programs/type-union-strict-null-keep-description) + +```ts +/** + * Description of InnerObject. + */ +type InnerObject = { + /** + * Description of foo. + */ + foo: string; +}; + +/** + * Description of MyObject. + */ +type MyObject = { + + inner1?: InnerObject; + + /** + * Override description. + */ + inner2?: InnerObject; +}; +``` + + ## [type-union-tagged](./test/programs/type-union-tagged) ```ts @@ -1927,6 +2174,16 @@ interface MyObject { ``` +## [undefined-property](./test/programs/undefined-property) + +```ts +export type MyObject = { + a: string; + b: undefined; +}; +``` + + ## [unique-names](./test/programs/unique-names) ```ts diff --git a/package.json b/package.json index 8d306538..ca74a2f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typescript-json-schema", - "version": "0.55.0", + "version": "0.65.1", "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", @@ -42,12 +42,12 @@ ], "dependencies": { "@types/json-schema": "^7.0.9", - "@types/node": "^16.9.2", + "@types/node": "^18.11.9", "glob": "^7.1.7", - "path-equal": "^1.1.2", + "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", - "typescript": "~4.8.2", + "typescript": "~5.5.0", "yargs": "^17.1.1" }, "devDependencies": { diff --git a/test/programs/abstract-class/schema.json b/test/programs/abstract-class/schema.json index 89da901f..7f2e4873 100644 --- a/test/programs/abstract-class/schema.json +++ b/test/programs/abstract-class/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/abstract-extends/schema.json b/test/programs/abstract-extends/schema.json index ae4c6d86..f2169ce0 100644 --- a/test/programs/abstract-extends/schema.json +++ b/test/programs/abstract-extends/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/annotation-default/schema.json b/test/programs/annotation-default/schema.json index 54ad958a..e227243a 100644 --- a/test/programs/annotation-default/schema.json +++ b/test/programs/annotation-default/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "varBoolean": { "default": true, diff --git a/test/programs/annotation-id/schema.json b/test/programs/annotation-id/schema.json index a37577c9..80b4eb0d 100644 --- a/test/programs/annotation-id/schema.json +++ b/test/programs/annotation-id/schema.json @@ -1,9 +1,11 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MySubObject": { "$id": "filled#", "type": "object", + "additionalProperties": false, "properties": { "a": { "type": "boolean" } }, diff --git a/test/programs/annotation-items/schema.json b/test/programs/annotation-items/schema.json index 316b2f34..e84ac158 100644 --- a/test/programs/annotation-items/schema.json +++ b/test/programs/annotation-items/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "a": { "items": { diff --git a/test/programs/annotation-ref/schema.json b/test/programs/annotation-ref/schema.json index c2651a34..6f4395bb 100644 --- a/test/programs/annotation-ref/schema.json +++ b/test/programs/annotation-ref/schema.json @@ -2,9 +2,11 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MySubObject": { + "additionalProperties": false, "type": "object" } }, + "additionalProperties": false, "properties": { "externalRef": { "$ref": "http://my-schema.org" diff --git a/test/programs/annotation-required/schema.json b/test/programs/annotation-required/schema.json index ca051b8e..c8c4f2c8 100644 --- a/test/programs/annotation-required/schema.json +++ b/test/programs/annotation-required/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyDefaultObject": { + "additionalProperties": false, "properties": { "age": { "type": "number" @@ -17,6 +19,7 @@ "type": "object" }, "MySubObject": { + "additionalProperties": false, "properties": { "bool": { "type": "boolean" @@ -46,6 +49,7 @@ "type": "object" }, "MySubObject2": { + "additionalProperties": false, "properties": { "bool": { "type": "boolean" diff --git a/test/programs/annotation-title/main.ts b/test/programs/annotation-title/main.ts index af7b9d50..5a3f51f3 100644 --- a/test/programs/annotation-title/main.ts +++ b/test/programs/annotation-title/main.ts @@ -5,11 +5,18 @@ interface MySubObject { a: boolean; } +interface AnotherSubObject { + b: boolean; +} + interface MyObject { /** * @title empty# */ empty; - + /** + * @title filled + */ filled: MySubObject; + nonTitled: AnotherSubObject; } diff --git a/test/programs/annotation-title/schema.json b/test/programs/annotation-title/schema.json index 7d11b17b..d2b09ede 100644 --- a/test/programs/annotation-title/schema.json +++ b/test/programs/annotation-title/schema.json @@ -1,7 +1,19 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { + "AnotherSubObject": { + "additionalProperties": false, + "properties": { + "b": { + "type": "boolean" + } + }, + "required": ["b"], + "type": "object" + }, "MySubObject": { + "additionalProperties": false, "title": "filled#", "type": "object", "properties": { @@ -15,9 +27,13 @@ "title": "empty#" }, "filled": { - "$ref": "#/definitions/MySubObject" + "$ref": "#/definitions/MySubObject", + "title": "filled" + }, + "nonTitled": { + "$ref": "#/definitions/AnotherSubObject" } }, - "required": ["empty", "filled"], + "required": ["empty", "filled", "nonTitled"], "type": "object" } diff --git a/test/programs/annotation-tjs/schema.json b/test/programs/annotation-tjs/schema.json index 1ba52f39..477f8bd1 100644 --- a/test/programs/annotation-tjs/schema.json +++ b/test/programs/annotation-tjs/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "dateTime": { "format": "date-time", diff --git a/test/programs/any-unknown/schema.json b/test/programs/any-unknown/schema.json index c7088cd0..039760e1 100644 --- a/test/programs/any-unknown/schema.json +++ b/test/programs/any-unknown/schema.json @@ -1,5 +1,6 @@ { "type": "object", + "additionalProperties": false, "properties": { "a": {}, "b": {} diff --git a/test/programs/argument-id/schema.MyObject.json b/test/programs/argument-id/schema.MyObject.json index c16a13bb..582222ec 100644 --- a/test/programs/argument-id/schema.MyObject.json +++ b/test/programs/argument-id/schema.MyObject.json @@ -1,13 +1,13 @@ { "$id": "someSchemaId", "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "ReferenceType": { + "additionalProperties": false, "properties": { "reference": { - "enum": [ - true - ], + "const": true, "type": "boolean" } }, diff --git a/test/programs/array-and-description/schema.json b/test/programs/array-and-description/schema.json index f9be6bcf..14126456 100644 --- a/test/programs/array-and-description/schema.json +++ b/test/programs/array-and-description/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "description": { "type": "string" diff --git a/test/programs/builtin-names/schema.json b/test/programs/builtin-names/schema.json index 9c411a59..c19f242d 100644 --- a/test/programs/builtin-names/schema.json +++ b/test/programs/builtin-names/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Ext.Array": { + "additionalProperties": false, "type": "object" } }, diff --git a/test/programs/class-extends/schema.json b/test/programs/class-extends/schema.json index 4b9184fd..678701b9 100644 --- a/test/programs/class-extends/schema.json +++ b/test/programs/class-extends/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/class-single/schema.json b/test/programs/class-single/schema.json index 4b9184fd..678701b9 100644 --- a/test/programs/class-single/schema.json +++ b/test/programs/class-single/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/comments-comment/main.ts b/test/programs/comments-comment/main.ts new file mode 100644 index 00000000..35bd19a0 --- /dev/null +++ b/test/programs/comments-comment/main.ts @@ -0,0 +1,9 @@ +/** + * @$comment Object comment + */ +interface MyObject { + /** + * @$comment Property comment + */ + text: string; +} diff --git a/test/programs/comments-comment/schema.json b/test/programs/comments-comment/schema.json new file mode 100644 index 00000000..e6062458 --- /dev/null +++ b/test/programs/comments-comment/schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "$comment": "Object comment", + "properties": { + "text": { + "$comment": "Property comment", + "type": "string" + } + }, + "required": [ + "text" + ], + "type": "object" +} + diff --git a/test/programs/comments-from-lib/schema.json b/test/programs/comments-from-lib/schema.json index 2457b93c..ca5a9e8b 100644 --- a/test/programs/comments-from-lib/schema.json +++ b/test/programs/comments-from-lib/schema.json @@ -1,5 +1,6 @@ { "description": "Use this comment", + "additionalProperties": false, "type": "object", "properties": { "prop1": { diff --git a/test/programs/comments-imports/schema.json b/test/programs/comments-imports/schema.json index ebc25fad..aefa171e 100644 --- a/test/programs/comments-imports/schema.json +++ b/test/programs/comments-imports/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Color": { "description": "Description of Color.", @@ -7,6 +8,7 @@ "type": "string" }, "Text": { + "additionalProperties": false, "description": "Description of Text interface.", "properties": { "color": { diff --git a/test/programs/comments-inline-tags/schema.json b/test/programs/comments-inline-tags/schema.json index 5f72287f..38307a55 100644 --- a/test/programs/comments-inline-tags/schema.json +++ b/test/programs/comments-inline-tags/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "description": "This is MyObject. It extends {@link MyOtherObject} and {@link SomeOtherObject}.", "properties": { "prop1": { diff --git a/test/programs/comments-override/schema.json b/test/programs/comments-override/schema.json index 0629719c..360ce985 100644 --- a/test/programs/comments-override/schema.json +++ b/test/programs/comments-override/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MySubObject": { "additionalProperties": true, diff --git a/test/programs/comments/schema.json b/test/programs/comments/schema.json index febac880..302df4b6 100644 --- a/test/programs/comments/schema.json +++ b/test/programs/comments/schema.json @@ -19,6 +19,7 @@ "type": "array" }, "rotation": { + "additionalProperties": false, "description": "Description of rotation, a field with an anonymous type", "properties": { "yaw": { diff --git a/test/programs/const-as-enum/main.ts b/test/programs/const-as-enum/main.ts new file mode 100644 index 00000000..fd13ce55 --- /dev/null +++ b/test/programs/const-as-enum/main.ts @@ -0,0 +1,3 @@ +export interface MyObject { + reference: true; +} diff --git a/test/programs/const-as-enum/schema.json b/test/programs/const-as-enum/schema.json new file mode 100644 index 00000000..061c10c0 --- /dev/null +++ b/test/programs/const-as-enum/schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "reference": { + "enum": [ + true + ], + "type": "boolean" + } + }, + "required": [ + "reference" + ], + "type": "object" +} diff --git a/test/programs/const-keyword/main.ts b/test/programs/const-keyword/main.ts new file mode 100644 index 00000000..11087d3d --- /dev/null +++ b/test/programs/const-keyword/main.ts @@ -0,0 +1,4 @@ +const fn = (value: T) => + ({ value }); + +export type Object = ReturnType>; diff --git a/test/programs/const-keyword/schema.json b/test/programs/const-keyword/schema.json new file mode 100644 index 00000000..c2a28b7c --- /dev/null +++ b/test/programs/const-keyword/schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "value": { + "const": "value", + "type": "string" + } + }, + "required": ["value"], + "type": "object" +} + diff --git a/test/programs/custom-dates/schema.json b/test/programs/custom-dates/schema.json index 6da75ebc..07e4d266 100644 --- a/test/programs/custom-dates/schema.json +++ b/test/programs/custom-dates/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "foo.Date": { + "additionalProperties": false, "properties": { "day": { "type": "number" diff --git a/test/programs/dates/schema.json b/test/programs/dates/schema.json index fd6a408c..5ba132fb 100644 --- a/test/programs/dates/schema.json +++ b/test/programs/dates/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "var1": { "format": "date-time", diff --git a/test/programs/default-properties/schema.json b/test/programs/default-properties/schema.json index ebf855d3..17169a8d 100644 --- a/test/programs/default-properties/schema.json +++ b/test/programs/default-properties/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Foo": { "anyOf": [ diff --git a/test/programs/enums-compiled-compute/schema.json b/test/programs/enums-compiled-compute/schema.json index 3217bf03..5e9df0b4 100644 --- a/test/programs/enums-compiled-compute/schema.json +++ b/test/programs/enums-compiled-compute/schema.json @@ -1,10 +1,10 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "enum": [ - 1, 2, 4, - 6 + 6, + 1 ], "type": "number" } diff --git a/test/programs/enums-mixed/schema.json b/test/programs/enums-mixed/schema.json index 110931a4..3b91d6a3 100644 --- a/test/programs/enums-mixed/schema.json +++ b/test/programs/enums-mixed/schema.json @@ -1,13 +1,14 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Enum": { "enum": [ 0, 1, - null, + true, "str", - true + null ], "type": [ "number", diff --git a/test/programs/enums-number-initialized/schema.json b/test/programs/enums-number-initialized/schema.json index 480b2df6..01c66c33 100644 --- a/test/programs/enums-number-initialized/schema.json +++ b/test/programs/enums-number-initialized/schema.json @@ -1,10 +1,10 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "enum": [ - 1, 10, 11, - 12 + 12, + 1 ], "type": "number" } diff --git a/test/programs/enums-number/schema.json b/test/programs/enums-number/schema.json index 5f203b67..0f43dc0b 100644 --- a/test/programs/enums-number/schema.json +++ b/test/programs/enums-number/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Enum": { "enum": [ diff --git a/test/programs/enums-string/schema.json b/test/programs/enums-string/schema.json index 3944cfe8..1f7e1e67 100644 --- a/test/programs/enums-string/schema.json +++ b/test/programs/enums-string/schema.json @@ -1,11 +1,12 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Enum": { "enum": [ - "123", "x", - "y" + "y", + "123" ], "type": "string" } diff --git a/test/programs/enums-value-in-interface/schema.json b/test/programs/enums-value-in-interface/schema.json index 040e3919..6bf5f6b6 100644 --- a/test/programs/enums-value-in-interface/schema.json +++ b/test/programs/enums-value-in-interface/schema.json @@ -1,10 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "A.B": { - "enum": [ - 0 - ], + "const": 0, "type": "number" } }, diff --git a/test/programs/force-type-imported/schema.json b/test/programs/force-type-imported/schema.json index 79e831f7..eaa6e6c9 100644 --- a/test/programs/force-type-imported/schema.json +++ b/test/programs/force-type-imported/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Widget": { "type": "number" diff --git a/test/programs/force-type/schema.json b/test/programs/force-type/schema.json index 79e831f7..eaa6e6c9 100644 --- a/test/programs/force-type/schema.json +++ b/test/programs/force-type/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Widget": { "type": "number" diff --git a/test/programs/generate-all-types/schema.json b/test/programs/generate-all-types/schema.json index 0bdd50da..80abeced 100644 --- a/test/programs/generate-all-types/schema.json +++ b/test/programs/generate-all-types/schema.json @@ -2,15 +2,15 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MyEnum": { - "enum": [ - 0 - ], + "const": 0, "type": "number" }, "MyInterface": { + "additionalProperties": false, "type": "object" }, "MyObject": { + "additionalProperties": false, "type": "object" } } diff --git a/test/programs/generic-anonymous/schema.json b/test/programs/generic-anonymous/schema.json index ebf99735..877856f4 100644 --- a/test/programs/generic-anonymous/schema.json +++ b/test/programs/generic-anonymous/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyGeneric": { + "additionalProperties": false, "properties": { "a": { "type": "number" @@ -17,6 +19,7 @@ "type": "object" }, "MyGeneric": { + "additionalProperties": false, "properties": { "a": { "type": "string" diff --git a/test/programs/generic-arrays/schema.json b/test/programs/generic-arrays/schema.json index a023dfa3..36175fe1 100644 --- a/test/programs/generic-arrays/schema.json +++ b/test/programs/generic-arrays/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "numberArray": { "items": { diff --git a/test/programs/generic-multiargs/schema.json b/test/programs/generic-multiargs/schema.json index ebf99735..877856f4 100644 --- a/test/programs/generic-multiargs/schema.json +++ b/test/programs/generic-multiargs/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyGeneric": { + "additionalProperties": false, "properties": { "a": { "type": "number" @@ -17,6 +19,7 @@ "type": "object" }, "MyGeneric": { + "additionalProperties": false, "properties": { "a": { "type": "string" diff --git a/test/programs/generic-multiple/schema.json b/test/programs/generic-multiple/schema.json index 8c85ce6f..b87cde25 100644 --- a/test/programs/generic-multiple/schema.json +++ b/test/programs/generic-multiple/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyGeneric": { + "additionalProperties": false, "properties": { "field": { "type": "number" @@ -13,6 +15,7 @@ "type": "object" }, "MyGeneric": { + "additionalProperties": false, "properties": { "field": { "type": "string" diff --git a/test/programs/generic-recursive/schema.json b/test/programs/generic-recursive/schema.json index e27af0fd..c040119b 100644 --- a/test/programs/generic-recursive/schema.json +++ b/test/programs/generic-recursive/schema.json @@ -3,6 +3,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MyGeneric": { + "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/MyGeneric" @@ -14,6 +15,7 @@ "type": "object" }, "MyGeneric": { + "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/MyGeneric" @@ -25,6 +27,7 @@ "type": "object" }, "MyObject": { + "additionalProperties": false, "properties": { "value": { "$ref": "#/definitions/MyGeneric" diff --git a/test/programs/generic-simple/schema.json b/test/programs/generic-simple/schema.json index 1fbdd571..68bf6c6f 100644 --- a/test/programs/generic-simple/schema.json +++ b/test/programs/generic-simple/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyGeneric": { + "additionalProperties": false, "properties": { "field": { "type": "number" diff --git a/test/programs/ignored-required/schema.json b/test/programs/ignored-required/schema.json index 56b76ccd..0b176931 100644 --- a/test/programs/ignored-required/schema.json +++ b/test/programs/ignored-required/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "required": { "type": "boolean" diff --git a/test/programs/imports/schema.json b/test/programs/imports/schema.json index da58b264..d9f420ab 100644 --- a/test/programs/imports/schema.json +++ b/test/programs/imports/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyInterface": { + "additionalProperties": false, "properties": { "fieldInMain": { "type": "number" @@ -13,6 +15,7 @@ "type": "object" }, "MyInterface_1": { + "additionalProperties": false, "properties": { "fieldInModule1": { "type": "string" @@ -24,6 +27,7 @@ "type": "object" }, "MyInterface_2": { + "additionalProperties": false, "properties": { "fieldInModule2": { "type": "number" diff --git a/test/programs/interface-extends/schema.json b/test/programs/interface-extends/schema.json index 4b9184fd..678701b9 100644 --- a/test/programs/interface-extends/schema.json +++ b/test/programs/interface-extends/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/interface-multi/schema.json b/test/programs/interface-multi/schema.json index dbd7a28f..55265205 100644 --- a/test/programs/interface-multi/schema.json +++ b/test/programs/interface-multi/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MySubObject": { + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/interface-recursion/schema.json b/test/programs/interface-recursion/schema.json index 4744b0b7..8c959407 100644 --- a/test/programs/interface-recursion/schema.json +++ b/test/programs/interface-recursion/schema.json @@ -3,6 +3,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MyObject": { + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/interface-single/schema.json b/test/programs/interface-single/schema.json index 4b9184fd..678701b9 100644 --- a/test/programs/interface-single/schema.json +++ b/test/programs/interface-single/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/key-in-key-of-multi-underscores/main.ts b/test/programs/key-in-key-of-multi-underscores/main.ts new file mode 100644 index 00000000..5493a989 --- /dev/null +++ b/test/programs/key-in-key-of-multi-underscores/main.ts @@ -0,0 +1,17 @@ +type Util = { + __2Underscores: { + utilDeepKey2: string; + }; + ___3Underscores: { + utilDeepKey3: string; + }; + ____4Underscores: { + utilDeepKey4: string; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; diff --git a/test/programs/key-in-key-of-multi-underscores/schema.json b/test/programs/key-in-key-of-multi-underscores/schema.json new file mode 100644 index 00000000..56f59c79 --- /dev/null +++ b/test/programs/key-in-key-of-multi-underscores/schema.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "__2Underscores": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "utilDeepKey2": { + "type": "string" + } + }, + "required": [ + "utilDeepKey2" + ], + "type": "object" + }, + "type": "object" + }, + "___3Underscores": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "utilDeepKey3": { + "type": "string" + } + }, + "required": [ + "utilDeepKey3" + ], + "type": "object" + }, + "type": "object" + }, + "____4Underscores": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "utilDeepKey4": { + "type": "string" + } + }, + "required": [ + "utilDeepKey4" + ], + "type": "object" + }, + "type": "object" + } + }, + "required": [ + "__2Underscores", + "___3Underscores", + "____4Underscores" + ], + "type": "object" +} diff --git a/test/programs/key-in-key-of-multi/main.ts b/test/programs/key-in-key-of-multi/main.ts new file mode 100644 index 00000000..a9b5a98a --- /dev/null +++ b/test/programs/key-in-key-of-multi/main.ts @@ -0,0 +1,16 @@ +type Util = { + utilKey1: { + utilDeepKey11: string; + utilDeepKey12: number; + }; + utilKey2: { + utilDeepKey21: boolean; + utilDeepKey22: null; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; diff --git a/test/programs/key-in-key-of-multi/schema.json b/test/programs/key-in-key-of-multi/schema.json new file mode 100644 index 00000000..6a9a0235 --- /dev/null +++ b/test/programs/key-in-key-of-multi/schema.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "utilKey1": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "utilDeepKey11": { + "type": "string" + }, + "utilDeepKey12": { + "type": "number" + } + }, + "required": [ + "utilDeepKey11", + "utilDeepKey12" + ], + "type": "object" + }, + "type": "object" + }, + "utilKey2": { + "additionalProperties": { + "additionalProperties": false, + "properties": { + "utilDeepKey21": { + "type": "boolean" + }, + "utilDeepKey22": { + "type": "null" + } + }, + "required": [ + "utilDeepKey21", + "utilDeepKey22" + ], + "type": "object" + }, + "type": "object" + } + }, + "required": [ + "utilKey1", + "utilKey2" + ], + "type": "object" +} + diff --git a/test/programs/key-in-key-of-single/main.ts b/test/programs/key-in-key-of-single/main.ts new file mode 100644 index 00000000..6bae4b61 --- /dev/null +++ b/test/programs/key-in-key-of-single/main.ts @@ -0,0 +1,11 @@ +type Util = { + utilKey: { + utilDeepKey: string; + }; +}; + +export type Main = { + [Key in keyof Util]: { + [key: string]: Util[Key]; + }; +}; diff --git a/test/programs/key-in-key-of-single/schema.json b/test/programs/key-in-key-of-single/schema.json new file mode 100644 index 00000000..40e2690a --- /dev/null +++ b/test/programs/key-in-key-of-single/schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "type": "object", + "properties": { + "utilKey": { + "type": "object", + "additionalProperties": { + "additionalProperties": false, + "type": "object", + "properties": { + "utilDeepKey": { + "type": "string" + } + }, + "required": [ + "utilDeepKey" + ] + } + } + }, + "required": [ + "utilKey" + ] +} \ No newline at end of file diff --git a/test/programs/map-types/schema.json b/test/programs/map-types/schema.json index 605e1387..444c375d 100644 --- a/test/programs/map-types/schema.json +++ b/test/programs/map-types/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyMap1": { "additionalProperties": { @@ -18,6 +19,7 @@ "type": "object" }, "MyType": { + "additionalProperties": false, "type": "object" } }, diff --git a/test/programs/module-interface-single/schema.json b/test/programs/module-interface-single/schema.json index 4b9184fd..678701b9 100644 --- a/test/programs/module-interface-single/schema.json +++ b/test/programs/module-interface-single/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "number" diff --git a/test/programs/namespace-deep-1/schema.json b/test/programs/namespace-deep-1/schema.json index 4104b30c..8309af76 100644 --- a/test/programs/namespace-deep-1/schema.json +++ b/test/programs/namespace-deep-1/schema.json @@ -3,6 +3,7 @@ "$ref": "#/definitions/RootNamespace.Def", "definitions": { "RootNamespace.Def": { + "additionalProperties": false, "properties": { "nest": { "$ref": "#/definitions/RootNamespace.Def" @@ -26,6 +27,7 @@ "type": "object" }, "RootNamespace.SubNamespace.HelperA": { + "additionalProperties": false, "properties": { "propA": { "type": "number" @@ -41,6 +43,7 @@ "type": "object" }, "RootNamespace.SubNamespace.HelperB": { + "additionalProperties": false, "properties": { "propA": { "$ref": "#/definitions/RootNamespace.SubNamespace.HelperA" diff --git a/test/programs/namespace-deep-2/schema.json b/test/programs/namespace-deep-2/schema.json index 1aa5d97e..0684e257 100644 --- a/test/programs/namespace-deep-2/schema.json +++ b/test/programs/namespace-deep-2/schema.json @@ -3,6 +3,7 @@ "$ref": "#/definitions/RootNamespace.SubNamespace.HelperA", "definitions": { "RootNamespace.Def": { + "additionalProperties": false, "properties": { "nest": { "$ref": "#/definitions/RootNamespace.Def" @@ -26,6 +27,7 @@ "type": "object" }, "RootNamespace.SubNamespace.HelperA": { + "additionalProperties": false, "properties": { "propA": { "type": "number" @@ -41,6 +43,7 @@ "type": "object" }, "RootNamespace.SubNamespace.HelperB": { + "additionalProperties": false, "properties": { "propA": { "$ref": "#/definitions/RootNamespace.SubNamespace.HelperA" diff --git a/test/programs/never/schema.json b/test/programs/never/schema.json index 25667e53..e13cf6c8 100644 --- a/test/programs/never/schema.json +++ b/test/programs/never/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "propA": { "type": "string" diff --git a/test/programs/no-ref/main.ts b/test/programs/no-ref/main.ts new file mode 100644 index 00000000..ee048861 --- /dev/null +++ b/test/programs/no-ref/main.ts @@ -0,0 +1,9 @@ +type MySubType = { + id: string; +}; + +export type MyModule = { + address: MySubType & { extraProp: number }; + address2: MySubType; + address3: MySubType; +}; diff --git a/test/programs/no-ref/schema.json b/test/programs/no-ref/schema.json new file mode 100644 index 00000000..ce7e65c0 --- /dev/null +++ b/test/programs/no-ref/schema.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "address": { + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "extraProp": { + "type": "number" + } + }, + "required": ["extraProp", "id"] + }, + "address2": { + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": ["id"] + }, + "address3": { + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": ["id"] + } + }, + "additionalProperties": false, + "required": ["address", "address2", "address3"], + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/test/programs/no-unrelated-definitions/schema.MyOtherObjectWithOverride.json b/test/programs/no-unrelated-definitions/schema.MyOtherObjectWithOverride.json new file mode 100644 index 00000000..a4aa2220 --- /dev/null +++ b/test/programs/no-unrelated-definitions/schema.MyOtherObjectWithOverride.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "SomeOtherDefinition": { + "type": "string" + } + }, + "properties": { + "sub": { + "$ref": "#/definitions/SomeOtherDefinition" + } + }, + "type": "object" +} diff --git a/test/programs/no-unrelated-definitions/schema.program.json b/test/programs/no-unrelated-definitions/schema.program.json new file mode 100644 index 00000000..4eb968c7 --- /dev/null +++ b/test/programs/no-unrelated-definitions/schema.program.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "MyObject": { + "properties": { + "sub": { + "$ref": "#/definitions/SomeDefinition" + } + }, + "type": "object" + }, + "MyOtherObject": { + "properties": { + "sub": { + "$ref": "#/definitions/SomeOtherDefinition" + } + }, + "type": "object" + }, + "SomeDefinition": { + "properties": { + "is": { + "type": "string" + } + }, + "type": "object" + }, + "SomeOtherDefinition": { + "properties": { + "is": { + "type": "string" + } + }, + "type": "object" + }, + "UnrelatedDefinition": { + "type": "string" + } + } +} diff --git a/test/programs/numeric-keys-and-others/main.ts b/test/programs/numeric-keys-and-others/main.ts new file mode 100644 index 00000000..d668aaad --- /dev/null +++ b/test/programs/numeric-keys-and-others/main.ts @@ -0,0 +1,5 @@ +interface NumericKeysAndOthers { + [key: number]: number; + a: string; + b: boolean; +} diff --git a/test/programs/numeric-keys-and-others/schema.json b/test/programs/numeric-keys-and-others/schema.json new file mode 100644 index 00000000..96b0c0a3 --- /dev/null +++ b/test/programs/numeric-keys-and-others/schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "patternProperties": { + "^[0-9]+$": { + "type": "number" + } + }, + "properties": { + "a": { + "type": "string" + }, + "b": { + "type": "boolean" + } + }, + "required": [ + "a", + "b" + ], + "type": "object" +} \ No newline at end of file diff --git a/test/programs/object-numeric-index-as-property/schema.json b/test/programs/object-numeric-index-as-property/schema.json index 490013d2..24962da0 100644 --- a/test/programs/object-numeric-index-as-property/schema.json +++ b/test/programs/object-numeric-index-as-property/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "objAnonymous": { "additionalProperties": false, diff --git a/test/programs/optionals-derived/schema.json b/test/programs/optionals-derived/schema.json index 85d076c3..b795054d 100644 --- a/test/programs/optionals-derived/schema.json +++ b/test/programs/optionals-derived/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "type": "object", "required": [ "baseRequired", "derivedRequired" ], "properties": { diff --git a/test/programs/optionals/schema.json b/test/programs/optionals/schema.json index 2d82cce9..d6dd1c89 100644 --- a/test/programs/optionals/schema.json +++ b/test/programs/optionals/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "optional": { "type": "number" diff --git a/test/programs/private-members/schema.json b/test/programs/private-members/schema.json index d25393ed..2c0c5235 100644 --- a/test/programs/private-members/schema.json +++ b/test/programs/private-members/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "publicMember": { "type": "string" diff --git a/test/programs/prop-override/schema.json b/test/programs/prop-override/schema.json index fd604067..fc5b7be6 100644 --- a/test/programs/prop-override/schema.json +++ b/test/programs/prop-override/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "_id": { "description": "Overrides aliased type definition with this JSDoc if at least TJS-type annotation is present", diff --git a/test/programs/satisfies-keyword/main.ts b/test/programs/satisfies-keyword/main.ts new file mode 100644 index 00000000..bf8029f3 --- /dev/null +++ b/test/programs/satisfies-keyword/main.ts @@ -0,0 +1,14 @@ +interface Basic { + a: string; + b: number; + c: boolean; +} + +const myObject = { + a: "a" as const, + b: 1 as const, + c: true as const, +// tslint:disable-next-line:variable-name +} satisfies Basic; + +export type Specific = typeof myObject; diff --git a/test/programs/satisfies-keyword/schema.json b/test/programs/satisfies-keyword/schema.json new file mode 100644 index 00000000..77121303 --- /dev/null +++ b/test/programs/satisfies-keyword/schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "a": { + "const": "a", + "type": "string" + }, + "b": { + "const": 1, + "type": "number" + }, + "c": { + "const": true, + "type": "boolean" + } + }, + "required": [ + "a", + "b", + "c" + ], + "type": "object" +} diff --git a/test/programs/strict-null-checks/schema.json b/test/programs/strict-null-checks/schema.json index 3d7ab469..6b9965b6 100644 --- a/test/programs/strict-null-checks/schema.json +++ b/test/programs/strict-null-checks/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "val": { "type": "number" @@ -14,23 +15,17 @@ "type": "number" }, "valTrue": { - "enum": [ - true - ], + "const": true, "type": "boolean" }, "valTrueOpt": { - "enum": [ - true - ], + "const": true, "type": "boolean" }, "valTrueOrNull": { "anyOf": [ { - "enum": [ - true - ], + "const": true, "type": "boolean" }, { diff --git a/test/programs/string-literals-inline/schema.json b/test/programs/string-literals-inline/schema.json index 809968bc..55c215f2 100644 --- a/test/programs/string-literals-inline/schema.json +++ b/test/programs/string-literals-inline/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "bar": { "type": "string" diff --git a/test/programs/string-literals/schema.json b/test/programs/string-literals/schema.json index 36f53123..de00a89d 100644 --- a/test/programs/string-literals/schema.json +++ b/test/programs/string-literals/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "result": { "enum": [ diff --git a/test/programs/string-template-literal/main.ts b/test/programs/string-template-literal/main.ts new file mode 100644 index 00000000..f554704e --- /dev/null +++ b/test/programs/string-template-literal/main.ts @@ -0,0 +1,12 @@ +interface MyObject { + a: `@${string}`, + b: `@${number}`, + c: `@${bigint}`, + d: `@${boolean}`, + e: `@${undefined}`, + f: `@${null}`, + g: `${string}@`, + h: `${number}@`, + i: `${string}@${number}`, + j: `${string}.${string}`, +} \ No newline at end of file diff --git a/test/programs/string-template-literal/schema.json b/test/programs/string-template-literal/schema.json new file mode 100644 index 00000000..cc1e1e08 --- /dev/null +++ b/test/programs/string-template-literal/schema.json @@ -0,0 +1,62 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "string", + "pattern": "^@.*$" + }, + "b": { + "type": "string", + "pattern": "^@[0-9]*$" + }, + "c": { + "type": "string", + "pattern": "^@[0-9]*$" + }, + "d": { + "enum": [ + "@false", + "@true" + ], + "type": "string" + }, + "e": { + "type": "string", + "const": "@undefined" + }, + "f": { + "type": "string", + "const": "@null" + }, + "g": { + "type": "string", + "pattern": "^.*@$" + }, + "h": { + "type": "string", + "pattern": "^[0-9]*@$" + }, + "i": { + "type": "string", + "pattern": "^.*@[0-9]*$" + }, + "j": { + "type": "string", + "pattern": "^.*\\..*$" + } + }, + "additionalProperties": false, + "required": [ + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j" + ], + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/test/programs/symbol/main.ts b/test/programs/symbol/main.ts new file mode 100644 index 00000000..cfc7904d --- /dev/null +++ b/test/programs/symbol/main.ts @@ -0,0 +1,3 @@ +export type MyObject = { + a: symbol; +}; diff --git a/test/programs/symbol/schema.json b/test/programs/symbol/schema.json new file mode 100644 index 00000000..c963eae3 --- /dev/null +++ b/test/programs/symbol/schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "type": "object", + "properties": { + "a": { + "type": "object" + } + }, + "required": [ + "a" + ] +} \ No newline at end of file diff --git a/test/programs/type-alias-never/main.ts b/test/programs/type-alias-never/main.ts new file mode 100644 index 00000000..38604b53 --- /dev/null +++ b/test/programs/type-alias-never/main.ts @@ -0,0 +1 @@ +export type MyNever = never; diff --git a/test/programs/type-alias-never/schema.json b/test/programs/type-alias-never/schema.json new file mode 100644 index 00000000..2481e112 --- /dev/null +++ b/test/programs/type-alias-never/schema.json @@ -0,0 +1 @@ +"Creating a schema for alias of never will fail" \ No newline at end of file diff --git a/test/programs/type-alias-or/schema.json b/test/programs/type-alias-or/schema.json index e021616e..0c901c29 100644 --- a/test/programs/type-alias-or/schema.json +++ b/test/programs/type-alias-or/schema.json @@ -1,10 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "A": { + "additionalProperties": false, "type": "object" }, "B": { + "additionalProperties": false, "type": "object" }, "C": { diff --git a/test/programs/type-alias-undefined/main.ts b/test/programs/type-alias-undefined/main.ts new file mode 100644 index 00000000..dba9eea5 --- /dev/null +++ b/test/programs/type-alias-undefined/main.ts @@ -0,0 +1 @@ +export type MyUndefined = undefined; diff --git a/test/programs/type-alias-undefined/schema.json b/test/programs/type-alias-undefined/schema.json new file mode 100644 index 00000000..102f279d --- /dev/null +++ b/test/programs/type-alias-undefined/schema.json @@ -0,0 +1 @@ +"Creating a schema for alias of undefined will fail" \ No newline at end of file diff --git a/test/programs/type-aliases-alias-ref/schema.json b/test/programs/type-aliases-alias-ref/schema.json index e100bbe8..b98e0ff6 100644 --- a/test/programs/type-aliases-alias-ref/schema.json +++ b/test/programs/type-aliases-alias-ref/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "prop": { "type": "number" diff --git a/test/programs/type-aliases-local-namsepace/schema.json b/test/programs/type-aliases-local-namsepace/schema.json index b99a5688..51e876dd 100644 --- a/test/programs/type-aliases-local-namsepace/schema.json +++ b/test/programs/type-aliases-local-namsepace/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "B.B": { + "additionalProperties": false, "properties": { "b": { } @@ -12,6 +14,7 @@ "type": "object" }, "C.C": { + "additionalProperties": false, "properties": { "c": { "$ref": "#/definitions/B.B" diff --git a/test/programs/type-aliases-multitype-array/schema.json b/test/programs/type-aliases-multitype-array/schema.json index ca5a1f7b..4eb71d6e 100644 --- a/test/programs/type-aliases-multitype-array/schema.json +++ b/test/programs/type-aliases-multitype-array/schema.json @@ -2,6 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MyObject": { + "additionalProperties": false, "properties": { "array": { "items": { diff --git a/test/programs/type-aliases-partial/schema.json b/test/programs/type-aliases-partial/schema.json index 798ddab5..b41bc0c0 100644 --- a/test/programs/type-aliases-partial/schema.json +++ b/test/programs/type-aliases-partial/schema.json @@ -1,5 +1,6 @@ { "type": "object", + "additionalProperties": false, "properties": { "foo": { "$ref": "#/definitions/Partial" @@ -14,6 +15,7 @@ ], "definitions": { "__type": { + "additionalProperties": false, "type": "object", "properties": { "x": { @@ -29,6 +31,7 @@ }, "__type_1": { "type": "object", + "additionalProperties": false, "properties": { "a": { "type": "number" diff --git a/test/programs/type-aliases-recursive-object-topref/schema.json b/test/programs/type-aliases-recursive-object-topref/schema.json index f3db0536..d11ace0c 100644 --- a/test/programs/type-aliases-recursive-object-topref/schema.json +++ b/test/programs/type-aliases-recursive-object-topref/schema.json @@ -6,6 +6,7 @@ "$ref": "#/definitions/MyObject" }, "MyObject": { + "additionalProperties": false, "properties": { "alias": { "$ref": "#/definitions/MyAlias" diff --git a/test/programs/type-aliases-tuple-with-names/main.ts b/test/programs/type-aliases-tuple-with-names/main.ts new file mode 100644 index 00000000..d594c52c --- /dev/null +++ b/test/programs/type-aliases-tuple-with-names/main.ts @@ -0,0 +1 @@ +export type MyTuple = [a: string, b: 123, c?: boolean, ...d: number[]]; diff --git a/test/programs/type-aliases-tuple-with-names/schema.json b/test/programs/type-aliases-tuple-with-names/schema.json new file mode 100644 index 00000000..e33e4866 --- /dev/null +++ b/test/programs/type-aliases-tuple-with-names/schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "array", + "items": [ + { + "title": "a", + "type": "string" + }, + { + "title": "b", + "type": "number", + "const": 123 + }, + { + "title": "c", + "type": "boolean" + } + ], + "minItems": 2, + "additionalItems": { + "title": "d", + "type": "number" + } +} diff --git a/test/programs/type-aliases-union-namespace/schema.json b/test/programs/type-aliases-union-namespace/schema.json index 1690f8b7..ee00df40 100644 --- a/test/programs/type-aliases-union-namespace/schema.json +++ b/test/programs/type-aliases-union-namespace/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "Cardinal": { "enum": [ diff --git a/test/programs/type-aliases/schema.json b/test/programs/type-aliases/schema.json index abd02bd6..da750719 100644 --- a/test/programs/type-aliases/schema.json +++ b/test/programs/type-aliases/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyAlias": { "$ref": "#/definitions/MySubObject", @@ -10,6 +11,7 @@ "type": "string" }, "MySubObject": { + "additionalProperties": false, "description": "My sub object", "properties": { "propA": { diff --git a/test/programs/type-anonymous/schema.json b/test/programs/type-anonymous/schema.json index 87c34470..da9e9668 100644 --- a/test/programs/type-anonymous/schema.json +++ b/test/programs/type-anonymous/schema.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "FieldWithAnonType": { + "additionalProperties": false, "properties": { "SubfieldA": { "type": "number" @@ -13,6 +15,7 @@ ] }, "SubfieldC": { + "additionalProperties": false, "properties": { "SubsubfieldA": { "items": { diff --git a/test/programs/type-intersection-recursive-no-additional/main.ts b/test/programs/type-intersection-recursive-no-additional/main.ts new file mode 100644 index 00000000..73adb1e1 --- /dev/null +++ b/test/programs/type-intersection-recursive-no-additional/main.ts @@ -0,0 +1,9 @@ +type MyRecursiveNode = { + next?: MyNode; +} + +type MyNode = { + val: string; +} & MyRecursiveNode; + +type MyLinkedList = MyNode; \ No newline at end of file diff --git a/test/programs/type-intersection-recursive-no-additional/schema.json b/test/programs/type-intersection-recursive-no-additional/schema.json new file mode 100644 index 00000000..cecdca22 --- /dev/null +++ b/test/programs/type-intersection-recursive-no-additional/schema.json @@ -0,0 +1,21 @@ +{ + "$ref": "#/definitions/MyNode", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "MyNode": { + "additionalProperties": false, + "properties": { + "next": { + "$ref": "#/definitions/MyNode" + }, + "val": { + "type": "string" + } + }, + "required": [ + "val" + ], + "type": "object" + } + } +} \ No newline at end of file diff --git a/test/programs/type-intersection-recursive/main.ts b/test/programs/type-intersection-recursive/main.ts index 138f3b57..a5c17469 100644 --- a/test/programs/type-intersection-recursive/main.ts +++ b/test/programs/type-intersection-recursive/main.ts @@ -2,5 +2,5 @@ interface ChildFoo { } interface Foo { - readonly childFoos: Foo & ChildFoo; + readonly childFoos: Foo | ChildFoo; } diff --git a/test/programs/type-intersection-recursive/schema.json b/test/programs/type-intersection-recursive/schema.json index a784da6c..aff6b55e 100644 --- a/test/programs/type-intersection-recursive/schema.json +++ b/test/programs/type-intersection-recursive/schema.json @@ -1,18 +1,21 @@ { + "$ref": "#/definitions/Foo", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "ChildFoo": { + "additionalProperties": false, "type": "object" }, "Foo": { + "additionalProperties": false, "properties": { "childFoos": { - "allOf": [ + "anyOf": [ { - "$ref": "#/definitions/Foo" + "$ref": "#/definitions/ChildFoo" }, { - "$ref": "#/definitions/ChildFoo" + "$ref": "#/definitions/Foo" } ] } diff --git a/test/programs/type-literals/main.ts b/test/programs/type-literals/main.ts new file mode 100644 index 00000000..4e3a3131 --- /dev/null +++ b/test/programs/type-literals/main.ts @@ -0,0 +1,8 @@ +type MyObject = { + param1: "1" | "2" | "3"; + param2: "1" | "2" | 3 | true; + /** @enum {string} */ + param3: "1" | "2" | "3"; + /** @enum {unknown} */ + param4: "1" | "2" | 3 | true; +}; diff --git a/test/programs/type-literals/schema.json b/test/programs/type-literals/schema.json new file mode 100644 index 00000000..ce97b1df --- /dev/null +++ b/test/programs/type-literals/schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "param1": { + "enum": ["1", "2", "3"], + "type": "string" + }, + "param2": { + "enum": ["1", "2", 3, true] + }, + "param3": { + "enum": ["1", "2", "3"], + "type": "string" + }, + "param4": { + "enum": ["1", "2", 3, true] + } + }, + "required": ["param1", "param2", "param3", "param4"], + "type": "object" +} diff --git a/test/programs/type-mapped-types/schema.json b/test/programs/type-mapped-types/schema.json index a29918f6..62ca7a4d 100644 --- a/test/programs/type-mapped-types/schema.json +++ b/test/programs/type-mapped-types/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "str1": { "type": "string" diff --git a/test/programs/type-no-aliases-recursive-topref/schema.json b/test/programs/type-no-aliases-recursive-topref/schema.json index 56159201..f86162cf 100644 --- a/test/programs/type-no-aliases-recursive-topref/schema.json +++ b/test/programs/type-no-aliases-recursive-topref/schema.json @@ -3,6 +3,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "MyObject": { + "additionalProperties": false, "properties": { "alias": { "$ref": "#/definitions/MyObject" diff --git a/test/programs/type-nullable/schema.json b/test/programs/type-nullable/schema.json index 988af06a..91036b03 100644 --- a/test/programs/type-nullable/schema.json +++ b/test/programs/type-nullable/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyType2": { "type": [ @@ -21,6 +22,7 @@ ] }, "MyType6": { + "additionalProperties": false, "type": "object" } }, @@ -72,6 +74,7 @@ "type": "number" } }, + "additionalProperties": false, "required": [ "foo" ], diff --git a/test/programs/type-primitives/schema.json b/test/programs/type-primitives/schema.json index ef6a8b40..dadd3a34 100644 --- a/test/programs/type-primitives/schema.json +++ b/test/programs/type-primitives/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "array1": { "default": null, diff --git a/test/programs/type-recursive/schema.json b/test/programs/type-recursive/schema.json index d2a59a30..ef024db2 100644 --- a/test/programs/type-recursive/schema.json +++ b/test/programs/type-recursive/schema.json @@ -3,6 +3,7 @@ "$ref": "#/definitions/TestChildren", "definitions": { "TestChild": { + "additionalProperties": false, "properties": { "type": { "type": "string" diff --git a/test/programs/type-union-strict-null-keep-description/main.ts b/test/programs/type-union-strict-null-keep-description/main.ts new file mode 100644 index 00000000..331be151 --- /dev/null +++ b/test/programs/type-union-strict-null-keep-description/main.ts @@ -0,0 +1,22 @@ +/** + * Description of InnerObject. + */ +type InnerObject = { + /** + * Description of foo. + */ + foo: string; +}; + +/** + * Description of MyObject. + */ +type MyObject = { + + inner1?: InnerObject; + + /** + * Override description. + */ + inner2?: InnerObject; +}; diff --git a/test/programs/type-union-strict-null-keep-description/schema.json b/test/programs/type-union-strict-null-keep-description/schema.json new file mode 100644 index 00000000..4758f995 --- /dev/null +++ b/test/programs/type-union-strict-null-keep-description/schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "description": "Description of MyObject.", + "properties": { + "inner1": { + "additionalProperties": false, + "description": "Description of InnerObject.", + "properties": { + "foo": { + "description": "Description of foo.", + "type": "string" + } + }, + "required": [ + "foo" + ], + "type": "object" + }, + "inner2": { + "additionalProperties": false, + "description": "Override description.", + "properties": { + "foo": { + "description": "Description of foo.", + "type": "string" + } + }, + "required": [ + "foo" + ], + "type": "object" + } + }, + "type": "object" +} + diff --git a/test/programs/type-union-tagged/schema.json b/test/programs/type-union-tagged/schema.json index 21829333..47ffa0b0 100644 --- a/test/programs/type-union-tagged/schema.json +++ b/test/programs/type-union-tagged/schema.json @@ -13,11 +13,10 @@ ], "definitions": { "Circle": { + "additionalProperties": false, "properties": { "kind": { - "enum": [ - "circle" - ], + "const": "circle", "type": "string" }, "radius": { @@ -31,14 +30,13 @@ "type": "object" }, "Rectangle": { + "additionalProperties": false, "properties": { "height": { "type": "number" }, "kind": { - "enum": [ - "rectangle" - ], + "const": "rectangle", "type": "string" }, "width": { @@ -53,11 +51,10 @@ "type": "object" }, "Square": { + "additionalProperties": false, "properties": { "kind": { - "enum": [ - "square" - ], + "const": "square", "type": "string" }, "size": { diff --git a/test/programs/type-union/schema.json b/test/programs/type-union/schema.json index b3ea47d8..6ea87de6 100644 --- a/test/programs/type-union/schema.json +++ b/test/programs/type-union/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "definitions": { "MyType1": { "type": [ diff --git a/test/programs/typeof-keyword/schema.json b/test/programs/typeof-keyword/schema.json index 40c55279..77b9eecf 100644 --- a/test/programs/typeof-keyword/schema.json +++ b/test/programs/typeof-keyword/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "foo": { "typeof": "function" diff --git a/test/programs/undefined-property/main.ts b/test/programs/undefined-property/main.ts new file mode 100644 index 00000000..2a684d7c --- /dev/null +++ b/test/programs/undefined-property/main.ts @@ -0,0 +1,4 @@ +export type MyObject = { + a: string; + b: undefined; +}; diff --git a/test/programs/undefined-property/schema.json b/test/programs/undefined-property/schema.json new file mode 100644 index 00000000..28db415d --- /dev/null +++ b/test/programs/undefined-property/schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "type": "object", + "properties": { + "a": { + "type": "string" + } + }, + "required": [ + "a" + ] +} \ No newline at end of file diff --git a/test/programs/unique-names-multiple-subdefinitions/schema.json b/test/programs/unique-names-multiple-subdefinitions/schema.json index 79b51025..e738adaa 100644 --- a/test/programs/unique-names-multiple-subdefinitions/schema.json +++ b/test/programs/unique-names-multiple-subdefinitions/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "sub": { "$ref": "#/definitions/SubObject.0eb4e9af" @@ -11,11 +12,10 @@ ], "definitions": { "SubObject.0eb4e9af": { + "additionalProperties": false, "properties": { "is": { - "enum": [ - "SubObject_1" - ], + "const": "SubObject_1", "type": "string" } }, diff --git a/test/programs/unique-names/schema.MyObject.f2191116.json b/test/programs/unique-names/schema.MyObject.f2191116.json index b177159e..cb63da87 100644 --- a/test/programs/unique-names/schema.MyObject.f2191116.json +++ b/test/programs/unique-names/schema.MyObject.f2191116.json @@ -1,11 +1,10 @@ { "type": "object", + "additionalProperties": false, "properties": { "is": { "type": "string", - "enum": [ - "MyObject_1" - ] + "const": "MyObject_1" } }, "required": [ diff --git a/test/programs/unique-names/schema.MyObject.fded1213.json b/test/programs/unique-names/schema.MyObject.fded1213.json index aeb2da1b..6b129d23 100644 --- a/test/programs/unique-names/schema.MyObject.fded1213.json +++ b/test/programs/unique-names/schema.MyObject.fded1213.json @@ -1,11 +1,10 @@ { "type": "object", + "additionalProperties": false, "properties": { "is": { "type": "string", - "enum": [ - "MyObject_2" - ] + "const": "MyObject_2" } }, "required": [ diff --git a/test/programs/user-symbols/schema.json b/test/programs/user-symbols/schema.json index 0a0e4c1a..8720501f 100644 --- a/test/programs/user-symbols/schema.json +++ b/test/programs/user-symbols/schema.json @@ -2,6 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Context": { + "additionalProperties": false, "properties": { "ip": { "type": "string" diff --git a/test/programs/user-validation-keywords/schema.json b/test/programs/user-validation-keywords/schema.json index a53aadd0..3726a3b6 100644 --- a/test/programs/user-validation-keywords/schema.json +++ b/test/programs/user-validation-keywords/schema.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, "properties": { "name": { "chance": { diff --git a/test/schema.test.ts b/test/schema.test.ts index 6b6bd3b3..3effcb16 100644 --- a/test/schema.test.ts +++ b/test/schema.test.ts @@ -44,6 +44,9 @@ export function assertSchema( if (!("required" in settings)) { settings.required = true; } + if (!("noExtraProps" in settings)) { + settings.noExtraProps = true; + } const files = [resolve(BASE + group + "/main.ts")]; const actual = TJS.generateSchema(TJS.getProgramFromFiles(files, compilerOptions), type, settings, files); @@ -59,7 +62,6 @@ export function assertSchema( // test against the meta schema if (actual !== null) { ajv.validateSchema(actual); - assert.equal(ajv.errors, null, "The schema is not valid"); // Compiling the schema can reveal warnings that validateSchema doesn't. @@ -83,6 +85,10 @@ export function assertSchemas( settings.required = true; } + if (!("noExtraProps" in settings)) { + settings.noExtraProps = true; + } + const generator = TJS.buildGenerator( TJS.getProgramFromFiles([resolve(BASE + group + "/main.ts")], compilerOptions), settings @@ -113,7 +119,8 @@ export function assertRejection( group: string, type: string, settings: TJS.PartialArgs = {}, - compilerOptions?: TJS.CompilerOptions + compilerOptions?: TJS.CompilerOptions, + errType?: RegExp | ErrorConstructor, ) { it(group + " should reject input", () => { let schema = null; @@ -122,9 +129,13 @@ export function assertRejection( settings.required = true; } + if (!("noExtraProps" in settings)) { + settings.noExtraProps = true; + } + const files = [resolve(BASE + group + "/main.ts")]; schema = TJS.generateSchema(TJS.getProgramFromFiles(files, compilerOptions), type, settings, files); - }); + }, errType || /.*/); assert.equal(schema, null, "Expected no schema to be generated"); }); } @@ -157,6 +168,52 @@ describe("interfaces", () => { assert.deepEqual(schema.definitions!["MySubObject"], schemaOverride); } }); + it("should output the schemas set by setSchemaOverride with getSchemaForSymbol", () => { + const program = TJS.getProgramFromFiles([resolve(BASE + "interface-multi/main.ts")]); + const generator = TJS.buildGenerator(program); + assert(generator !== null); + + const schemaOverride1: TJS.Definition = { type: "string" }; + const schemaOverride2: TJS.Definition = { type: "integer" }; + + generator?.setSchemaOverride("MySubObject", schemaOverride1); + generator?.setSchemaOverride("MySubObject2", schemaOverride2); + const schema = generator?.getSchemaForSymbol("MySubObject"); + + // Should not change original schema object. + assert.deepEqual(schemaOverride1, { type: "string" }); + assert.deepEqual(schemaOverride2, { type: "integer" }); + + assert.deepEqual(schema, { ...schemaOverride1, $schema: "http://json-schema.org/draft-07/schema#" }); + }); + it("should output the schemas set by setSchemaOverride with getSchemaForSymbol and other overrides", () => { + const program = TJS.getProgramFromFiles([resolve(BASE + "interface-multi/main.ts")]); + const generator = TJS.buildGenerator(program); + assert(generator !== null); + const schemaOverride1: TJS.Definition = { type: "string" }; + const schemaOverride2: TJS.Definition = { type: "integer" }; + + generator?.setSchemaOverride("MySubObject1", schemaOverride1); + generator?.setSchemaOverride("MySubObject2", schemaOverride2); + 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(schema, { + ...schemaOverride1, + $schema: "http://json-schema.org/draft-07/schema#", + definitions: { + MySubObject1: { + type: "string" + }, + MySubObject2: { + type: "integer" + } + } + }); + }); it("should ignore type aliases that have schema overrides", () => { const program = TJS.getProgramFromFiles([resolve(BASE + "type-alias-schema-override/main.ts")]); const generator = TJS.buildGenerator(program); @@ -221,6 +278,7 @@ describe("schema", () => { // useTypeAliasRef: true, // useRootRef: true // }); + assertSchema("type-literals", "MyObject"); assertSchema("type-no-aliases-recursive-topref", "MyAlias", { aliasRef: false, topRef: true, @@ -239,8 +297,10 @@ describe("schema", () => { assertSchema("type-aliases-recursive-anonymous", "MyAlias"); assertSchema("type-aliases-recursive-export", "MyObject"); */ + assertSchema("type-aliases-tuple-with-names", "MyTuple"); assertSchema("type-aliases-tuple-of-variable-length", "MyTuple"); assertSchema("type-aliases-tuple-with-rest-element", "MyTuple"); + assertRejection("type-alias-never", "MyNever", {}, {}, /Unsupported type: never/); }); describe("enums", () => { @@ -259,7 +319,22 @@ describe("schema", () => { }); assertSchema("type-union-tagged", "Shape"); assertSchema("type-aliases-union-namespace", "MyModel"); - assertSchema("type-intersection-recursive", "*"); + assertSchema("type-intersection-recursive", "Foo"); + assertSchema("type-intersection-recursive-no-additional", "MyLinkedList", { + noExtraProps: true, + }); + assertSchema("type-union-strict-null-keep-description", "MyObject", undefined, { + strictNullChecks: true, + }); + }); + + describe("no-refs", () => { + assertSchema("no-ref", "MyModule", { + ref: false, + aliasRef: false, + topRef: false, + noExtraProps: true, + }); }); describe("annotations", () => { @@ -297,6 +372,7 @@ describe("schema", () => { describe("comments", () => { assertSchema("comments", "MyObject"); + assertSchema("comments-comment", "MyObject"); assertSchema("comments-override", "MyObject"); assertSchema("comments-imports", "MyObject", { aliasRef: true, @@ -351,6 +427,7 @@ describe("schema", () => { assertSchema("array-empty", "MyEmptyArray"); assertSchema("map-types", "MyObject"); assertSchema("extra-properties", "MyObject"); + assertSchema("numeric-keys-and-others", "NumericKeysAndOthers"); }); describe("string literals", () => { @@ -358,6 +435,10 @@ describe("schema", () => { assertSchema("string-literals-inline", "MyObject"); }); + describe("template string", () => { + assertSchema("string-template-literal", "MyObject"); + }); + describe("custom dates", () => { assertSchema("custom-dates", "foo.Bar"); }); @@ -390,6 +471,13 @@ describe("schema", () => { }); }); + describe("undefined", () => { + 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/); + }); + describe("other", () => { assertSchema("array-and-description", "MyObject"); @@ -421,6 +509,8 @@ describe("schema", () => { }); assertSchema("prop-override", "MyObject"); + + assertSchema("symbol", "MyObject"); }); describe("object index", () => { @@ -435,6 +525,12 @@ describe("schema", () => { describe("typeof globalThis", () => { assertSchema("type-globalThis", "Test"); }); + + describe("key in key of", () => { + assertSchema("key-in-key-of-single", "Main"); + assertSchema("key-in-key-of-multi", "Main"); + assertSchema("key-in-key-of-multi-underscores", "Main"); + }); }); describe("tsconfig.json", () => { @@ -471,19 +567,68 @@ describe("Functionality 'required' in annotation", () => { }); describe("when reusing a generator", () => { - it("should not add unrelated definitions to schemas", () => { - // regression test for https://github.com/YousefED/typescript-json-schema/issues/465 - const testProgramPath = BASE + "no-unrelated-definitions/"; - const program = TJS.programFromConfig(resolve(testProgramPath + "tsconfig.json")); - const generator = TJS.buildGenerator(program); + it("should not add unrelated definitions to schemas", () => { + // regression test for https://github.com/YousefED/typescript-json-schema/issues/465 + const testProgramPath = BASE + "no-unrelated-definitions/"; + const program = TJS.programFromConfig(resolve(testProgramPath + "tsconfig.json")); + const generator = TJS.buildGenerator(program); + + ["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`); + }); + }); - ["MyObject", "MyOtherObject"].forEach(symbolName => { - const expectedSchemaString = readFileSync(testProgramPath + `schema.${symbolName}.json`, "utf8"); - const expectedSchemaObject = JSON.parse(expectedSchemaString); + it("should not add unrelated schemaOverrides to schemas", () => { + const testProgramPath = BASE + "no-unrelated-definitions/"; + const program = TJS.programFromConfig(resolve(testProgramPath + "tsconfig.json")); + const generator = TJS.buildGenerator(program); + + const schemaOverride: TJS.Definition = { type: "string" }; + generator?.setSchemaOverride("SomeOtherDefinition", schemaOverride); + + [ + { symbolName: "MyObject", schemaName: "MyObject" }, + { symbolName: "MyOtherObject", schemaName: "MyOtherObjectWithOverride" }, + ].forEach(({ symbolName, schemaName }) => { + const expectedSchemaString = readFileSync(`${testProgramPath}schema.${schemaName}.json`, "utf8"); + const expectedSchemaObject = JSON.parse(expectedSchemaString); + + const actualSchemaObject = generator?.getSchemaForSymbol(symbolName); + + assert.deepEqual(actualSchemaObject, expectedSchemaObject, `The schema for ${symbolName} is not as expected`); + }); + }); + + it("should include all schemaOverrides when generating program schemas", () => { + const testProgramPath = BASE + "no-unrelated-definitions/"; + const program = TJS.programFromConfig(resolve(`${testProgramPath}tsconfig.json`)); + const generator = TJS.buildGenerator(program)!; - const actualSchemaObject = generator?.getSchemaForSymbol(symbolName); + const schemaOverride: TJS.Definition = { type: "string" }; + generator.setSchemaOverride("UnrelatedDefinition", schemaOverride); - assert.deepEqual(actualSchemaObject, expectedSchemaObject, `The schema for ${symbolName} is not as expected`); + const expectedSchemaString = readFileSync(`${testProgramPath}schema.program.json`, "utf8"); + const expectedSchemaObject = JSON.parse(expectedSchemaString); + + const actualSchemaObject = TJS.generateSchema(program, "*", {}, undefined, generator); + + assert.deepEqual(actualSchemaObject, expectedSchemaObject, `The schema for whole program is not as expected`); }); - }); +}); + +describe("satisfies keyword - ignore from a \"satisfies\" and build by rally type", () => { + assertSchema("satisfies-keyword", "Specific"); +}); + +describe("const keyword", () => { + assertSchema("const-keyword", "Object"); +}); + +describe("constAsEnum option", () => { + assertSchema("const-as-enum", "MyObject", { constAsEnum: true }); }); diff --git a/tsconfig.json b/tsconfig.json index 2a7c0c73..c2c005c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ "emitDecoratorMetadata": true, "declaration": true, "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, "strictNullChecks": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, @@ -19,8 +18,7 @@ "noLib": false, "preserveConstEnums": true, "sourceMap": true, - "watch": false, - "typeRoots" : ["node_modules/@types"] + "typeRoots" : ["node_modules/@types"], }, "include": [ "**/*.ts", diff --git a/typescript-json-schema-cli.ts b/typescript-json-schema-cli.ts index 11eb182b..c1bb17ba 100644 --- a/typescript-json-schema-cli.ts +++ b/typescript-json-schema-cli.ts @@ -32,6 +32,8 @@ export function run() { .describe("esModuleInterop", "Use esModuleInterop when loading typescript modules.") .boolean("skipLibCheck").default("skipLibCheck", defaultArgs.skipLibCheck) .describe("skipLibCheck", "Use skipLibCheck when loading typescript modules.") + .boolean("experimentalDecorators").default("experimentalDecorators", defaultArgs.experimentalDecorators) + .describe("skipLibCheck", "Use experimentalDecorators when loading typescript modules.") .boolean("ignoreErrors").default("ignoreErrors", defaultArgs.ignoreErrors) .describe("ignoreErrors", "Generate even if the program has errors.") .alias("out", "o") @@ -53,6 +55,8 @@ export function run() { .describe("defaultNumberType", "Default number type.") .boolean("tsNodeRegister").default("tsNodeRegister", defaultArgs.tsNodeRegister) .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") .argv; exec(args._[0], args._[1], { @@ -68,6 +72,7 @@ export function run() { strictNullChecks: args.strictNullChecks, esModuleInterop: args.esModuleInterop, skipLibCheck: args.skipLibCheck, + experimentalDecorators: args.experimentalDecorators, ignoreErrors: args.ignoreErrors, out: args.out, validationKeywords: args.validationKeywords, @@ -78,6 +83,7 @@ export function run() { id: args.id, defaultNumberType: args.defaultNumberType, tsNodeRegister: args.tsNodeRegister, + constAsEnum: args.constAsEnum, }); } diff --git a/typescript-json-schema.ts b/typescript-json-schema.ts index 41448513..f2730b86 100644 --- a/typescript-json-schema.ts +++ b/typescript-json-schema.ts @@ -3,7 +3,7 @@ import { stringify } from "safe-stable-stringify"; import * as path from "path"; import { createHash } from "crypto"; import * as ts from "typescript"; -import { JSONSchema7 } from "json-schema"; +import { JSONSchema7, JSONSchema7TypeName } from "json-schema"; import { pathEqual } from "path-equal"; export { Program, CompilerOptions, Symbol } from "typescript"; @@ -49,6 +49,7 @@ export function getDefaultArgs(): Args { strictNullChecks: false, esModuleInterop: false, skipLibCheck: false, + experimentalDecorators: true, ignoreErrors: false, out: "", validationKeywords: [], @@ -59,6 +60,7 @@ export function getDefaultArgs(): Args { id: "", defaultNumberType: "number", tsNodeRegister: false, + constAsEnum: false, }; } @@ -80,6 +82,7 @@ export type Args = { esModuleInterop: boolean; skipLibCheck: boolean; ignoreErrors: boolean; + experimentalDecorators: boolean; out: string; validationKeywords: string[]; include: string[]; @@ -89,6 +92,7 @@ export type Args = { id: string; defaultNumberType: "number" | "integer"; tsNodeRegister: boolean; + constAsEnum: boolean; }; export type PartialArgs = Partial; @@ -97,7 +101,6 @@ export type PrimitiveType = number | boolean | string | null; type MetaDefinitionFields = "ignore"; type RedefinedFields = - | "type" | "items" | "additionalItems" | "contains" @@ -116,9 +119,6 @@ type RedefinedFields = | "definitions"; export type DefinitionOrBoolean = Definition | boolean; export interface Definition extends Omit { - // The type field here is incompatible with the standard definition - type?: string | string[]; - // Non-standard fields propertyOrder?: string[]; defaultProperties?: string[]; @@ -151,6 +151,9 @@ export interface Definition extends Omit { }; } +/** A looser Definition type that allows for indexing with arbitrary strings. */ +type DefinitionIndex = { [key: string]: Definition[keyof Definition] }; + export type SymbolRef = { name: string; typeName: string; @@ -183,7 +186,7 @@ function extend(target: any, ..._: any[]): any { } function unique(arr: string[]): string[] { - const temp = {}; + const temp: Record = {}; for (const e of arr) { temp[e] = true; } @@ -286,12 +289,12 @@ function resolveTupleType(propertyType: ts.Type): ts.TupleTypeNode | null { return propertyType as any; } -const simpleTypesAllowedProperties = { +const simpleTypesAllowedProperties: Record = { type: true, description: true, }; -function addSimpleType(def: Definition, type: string): boolean { +function addSimpleType(def: Definition, type: JSONSchema7TypeName): boolean { for (const k in def) { if (!simpleTypesAllowedProperties[k]) { return false; @@ -330,11 +333,11 @@ function makeNullable(def: Definition): Definition { if (union) { union.push({ type: "null" }); } else { - const subdef = {}; - for (var k in def) { + const subdef: DefinitionIndex = {}; + for (var k in def as any) { if (def.hasOwnProperty(k)) { - subdef[k] = def[k]; - delete def[k]; + subdef[k] = def[k as keyof Definition]; + delete def[k as keyof typeof def]; } } def.anyOf = [subdef, { type: "null" }]; @@ -425,6 +428,7 @@ const validationKeywords = { $ref: true, id: true, $id: true, + $comment: true, title: true }; @@ -438,11 +442,12 @@ const annotationKeywords: { [k in keyof typeof validationKeywords]?: true } = { description: true, default: true, examples: true, + title: true, // A JSDoc $ref annotation can appear as a $ref. $ref: true, }; -const subDefinitions = { +const subDefinitions: Record = { items: true, additionalProperties: true, contains: true, @@ -489,6 +494,12 @@ export class JsonSchemaGenerator { */ private userValidationKeywords: ValidationKeywords; + /** + * If true, this makes constants be defined as enums with a single value. This is useful + * for cases where constant values are not supported, such as OpenAPI. + */ + private constAsEnum: boolean; + /** * Types are assigned names which are looked up by their IDs. This is the * map from type IDs to type names. @@ -514,6 +525,7 @@ export class JsonSchemaGenerator { this.inheritingTypes = inheritingTypes; this.tc = tc; this.userValidationKeywords = args.validationKeywords.reduce((acc, word) => ({ ...acc, [word]: true }), {}); + this.constAsEnum = args.constAsEnum; } public get ReffedDefinitions(): { [key: string]: Definition } { @@ -528,21 +540,23 @@ export class JsonSchemaGenerator { return false; } - private resetSchemaSpecificProperties() { + private resetSchemaSpecificProperties(includeAllOverrides: boolean = false) { this.reffedDefinitions = {}; this.typeIdsByName = {}; this.typeNamesById = {}; // restore schema overrides - this.schemaOverrides.forEach((value, key) => { - this.reffedDefinitions[key] = value; - }); + if (includeAllOverrides) { + this.schemaOverrides.forEach((value, key) => { + this.reffedDefinitions[key] = value; + }); + } } /** * Parse the comments of a symbol into the definition and other annotations. */ - private parseCommentsIntoDefinition(symbol: ts.Symbol, definition: Definition, otherAnnotations: {}): void { + private parseCommentsIntoDefinition(symbol: ts.Symbol, definition: Definition, otherAnnotations: Record): void { if (!symbol) { return; } @@ -554,16 +568,16 @@ export class JsonSchemaGenerator { if (comments.length) { definition.description = comments .map((comment) => { - const newlineNormalizedComment = comment.text.replace(/\r\n/g, "\n"); + const newlineNormalizedComment = comment.text.replace(/\r\n/g, "\n"); - // If a comment contains a "{@link XYZ}" inline tag that could not be - // resolved by the TS checker, then this comment will contain a trailing - // whitespace that we need to remove. - if (comment.kind === "linkText") { - return newlineNormalizedComment.trim(); - } + // If a comment contains a "{@link XYZ}" inline tag that could not be + // resolved by the TS checker, then this comment will contain a trailing + // whitespace that we need to remove. + if (comment.kind === "linkText") { + return newlineNormalizedComment.trim(); + } - return newlineNormalizedComment; + return newlineNormalizedComment; }) .join("").trim(); } @@ -605,7 +619,7 @@ export class JsonSchemaGenerator { if (match) { const k = match[1]; const v = match[2]; - definition[name] = { ...definition[name], [k]: v ? parseValue(symbol, k, v) : true }; + (definition as DefinitionIndex)[name] = { ...(definition as Record>)[name], [k]: v ? parseValue(symbol, k, v) : true }; return; } } @@ -613,16 +627,17 @@ export class JsonSchemaGenerator { // In TypeScript 3.7+, the "." is kept as part of the annotation name if (name.includes(".")) { const parts = name.split("."); - if (parts.length === 2 && subDefinitions[parts[0]]) { - definition[parts[0]] = { - ...definition[parts[0]], + const key = parts[0] as keyof Definition; + if (parts.length === 2 && subDefinitions[key]) { + (definition as DefinitionIndex)[key] = { + ...definition[key] as Record, [parts[1]]: text ? parseValue(symbol, name, text) : true, }; } } - if (validationKeywords[name] || this.userValidationKeywords[name]) { - definition[name] = text === undefined ? "" : parseValue(symbol, name, text); + if (validationKeywords[name as keyof typeof validationKeywords] || this.userValidationKeywords[name]) { + (definition as DefinitionIndex)[name] = text === undefined ? "" : parseValue(symbol, name, text); } else { // special annotations otherAnnotations[doc.name] = true; @@ -634,19 +649,28 @@ export class JsonSchemaGenerator { propertyType: ts.Type, reffedType: ts.Symbol, definition: Definition, - defaultNumberType = this.args.defaultNumberType + defaultNumberType = this.args.defaultNumberType, + ignoreUndefined = false, ): Definition { const tupleType = resolveTupleType(propertyType); if (tupleType) { // tuple const elemTypes: ts.NodeArray = (propertyType as any).typeArguments; - const fixedTypes = elemTypes.map((elType) => this.getTypeDefinition(elType as any)); + const targetTupleType = (propertyType as ts.TupleTypeReference).target; + + const fixedTypes = elemTypes.map((elType, index) => { + const def = this.getTypeDefinition(elType as any); + const label = targetTupleType.labeledElementDeclarations?.[index]?.name?.getFullText().trim(); + if (label) { + def.title = label; + } + return def; + }); definition.type = "array"; if (fixedTypes.length > 0) { definition.items = fixedTypes; } - const targetTupleType = (propertyType as ts.TupleTypeReference).target; definition.minItems = targetTupleType.minLength; if (targetTupleType.hasRestElement) { definition.additionalItems = fixedTypes[fixedTypes.length - 1]; @@ -674,11 +698,15 @@ export class JsonSchemaGenerator { } else if (flags & ts.TypeFlags.Boolean) { definition.type = "boolean"; } else if (flags & ts.TypeFlags.ESSymbol) { - definition.type = "symbol"; + definition.type = "object"; } else if (flags & ts.TypeFlags.Null) { definition.type = "null"; } else if (flags & ts.TypeFlags.Undefined || propertyTypeString === "void") { - definition.type = "undefined"; + if (!ignoreUndefined) { + throw new Error("Not supported: root type undefined"); + } + // will be deleted + definition.type = "undefined" as any; } else if (flags & ts.TypeFlags.Any || flags & ts.TypeFlags.Unknown) { // no type restriction, so that anything will match } else if (propertyTypeString === "Date" && !this.args.rejectDateType) { @@ -688,22 +716,86 @@ export class JsonSchemaGenerator { definition.type = "object"; definition.properties = {}; definition.additionalProperties = true; + } else if (propertyTypeString === "bigint") { + definition.type = "number"; + definition.properties = {}; + definition.additionalProperties = false; } else { const value = extractLiteralValue(propertyType); if (value !== undefined) { - definition.type = typeof value; - definition.enum = [value]; + // typeof value can be: "string", "boolean", "number", or "object" if value is null + const typeofValue = typeof value; + switch (typeofValue) { + case "string": + case "boolean": + definition.type = typeofValue; + break; + case "number": + definition.type = this.args.defaultNumberType; + break; + case "object": + definition.type = "null"; + break; + default: + throw new Error(`Not supported: ${value} as a enum value`); + } + if (this.constAsEnum) { + definition.enum = [value]; + } else { + definition.const = value; + } } else if (arrayType !== undefined) { 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")) { + this.getClassDefinition(propertyType, definition); + } + } else if (propertyType.flags & ts.TypeFlags.TemplateLiteral) { + definition.type = "string"; + // @ts-ignore + const {texts, types} = propertyType; + const pattern = []; + for (let i = 0; i < texts.length; i++) { + const text = texts[i].replace(/[\\^$.*+?()[\]{}|]/g, "\\$&"); + const type = types[i]; + + if (i === 0) { + pattern.push(`^`); + } + + if (type) { + if (type.flags & ts.TypeFlags.String) { + pattern.push(`${text}.*`); + } + + if (type.flags & ts.TypeFlags.Number + || type.flags & ts.TypeFlags.BigInt) { + pattern.push(`${text}[0-9]*`); + } + + if (type.flags & ts.TypeFlags.Undefined) { + pattern.push(`${text}undefined`); + } + + if (type.flags & ts.TypeFlags.Null) { + pattern.push(`${text}null`); + } + } + + + if (i === texts.length - 1) { + pattern.push(`${text}$`); + } + } + definition.pattern = pattern.join(""); } else { definition.type = "array"; if (!definition.items) { @@ -762,7 +854,7 @@ export class JsonSchemaGenerator { if (valDecl?.initializer) { let initial = valDecl.initializer; - while (ts.isTypeAssertion(initial)) { + while (ts.isTypeAssertionExpression(initial)) { initial = initial.expression; } @@ -803,11 +895,11 @@ export class JsonSchemaGenerator { const members: ts.NodeArray = node.kind === ts.SyntaxKind.EnumDeclaration ? (node as ts.EnumDeclaration).members - : ts.createNodeArray([node as ts.EnumMember]); + : ts.factory.createNodeArray([node as ts.EnumMember]); var enumValues: (number | boolean | string | null)[] = []; - const enumTypes: string[] = []; + const enumTypes: JSONSchema7TypeName[] = []; - const addType = (type: string) => { + const addType = (type: JSONSchema7TypeName) => { if (enumTypes.indexOf(type) === -1) { enumTypes.push(type); } @@ -818,7 +910,7 @@ export class JsonSchemaGenerator { const constantValue = this.tc.getConstantValue(member); if (constantValue !== undefined) { enumValues.push(constantValue); - addType(typeof constantValue); + addType(typeof constantValue as JSONSchema7TypeName); // can be only string or number; } else { // try to extract the enums value; it will probably by a cast expression const initial: ts.Expression | undefined = member.initializer; @@ -854,7 +946,11 @@ export class JsonSchemaGenerator { } if (enumValues.length > 0) { - definition.enum = enumValues.sort(); + if (enumValues.length > 1) { + definition.enum = enumValues; + } else { + definition.const = enumValues[0]; + } } return definition; @@ -862,15 +958,14 @@ export class JsonSchemaGenerator { private getUnionDefinition( unionType: ts.UnionType, - prop: ts.Symbol, - unionModifier: string, + unionModifier: keyof Definition, definition: Definition ): Definition { const enumValues: PrimitiveType[] = []; - const simpleTypes: string[] = []; + const simpleTypes: JSONSchema7TypeName[] = []; const schemas: Definition[] = []; - const pushSimpleType = (type: string) => { + const pushSimpleType = (type: JSONSchema7TypeName) => { if (simpleTypes.indexOf(type) === -1) { simpleTypes.push(type); } @@ -888,22 +983,19 @@ export class JsonSchemaGenerator { pushEnumValue(value); } else { const symbol = valueType.aliasSymbol; - const def = this.getTypeDefinition(valueType, undefined, undefined, symbol, symbol); - if (def.type === "undefined") { - if (prop) { - (prop).mayBeUndefined = true; - } - } else { - const keys = Object.keys(def); - if (keys.length === 1 && keys[0] === "type") { - if (typeof def.type !== "string") { - console.error("Expected only a simple type."); - } else { - pushSimpleType(def.type); - } + const def = this.getTypeDefinition(valueType, undefined, undefined, symbol, symbol, undefined, undefined, true); + if (def.type === "undefined" as any) { + continue; + } + const keys = Object.keys(def); + if (keys.length === 1 && keys[0] === "type") { + if (typeof def.type !== "string") { + console.error("Expected only a simple type."); } else { - schemas.push(def); + pushSimpleType(def.type); } + } else { + schemas.push(def); } } } @@ -919,7 +1011,7 @@ export class JsonSchemaGenerator { if (isOnlyBooleans) { pushSimpleType("boolean"); } else { - const enumSchema: Definition = { enum: enumValues.sort() }; + 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 ( @@ -953,20 +1045,24 @@ export class JsonSchemaGenerator { if (schemas.length === 1) { for (const k in schemas[0]) { if (schemas[0].hasOwnProperty(k)) { - definition[k] = schemas[0][k]; + if (k === "description" && definition.hasOwnProperty(k)) { + // If we already have a more specific description, don't overwrite it. + continue; + } + (definition as DefinitionIndex)[k] = schemas[0][k as keyof Definition]; } } } else { - definition[unionModifier] = schemas; + (definition as DefinitionIndex)[unionModifier] = schemas; } return definition; } private getIntersectionDefinition(intersectionType: ts.IntersectionType, definition: Definition): Definition { - const simpleTypes: string[] = []; + const simpleTypes: JSONSchema7TypeName[] = []; const schemas: Definition[] = []; - const pushSimpleType = (type: string) => { + const pushSimpleType = (type: JSONSchema7TypeName) => { if (simpleTypes.indexOf(type) === -1) { simpleTypes.push(type); } @@ -974,19 +1070,15 @@ export class JsonSchemaGenerator { for (const intersectionMember of intersectionType.types) { const def = this.getTypeDefinition(intersectionMember); - if (def.type === "undefined") { - console.error("Undefined in intersection makes no sense."); - } else { - const keys = Object.keys(def); - if (keys.length === 1 && keys[0] === "type") { - if (typeof def.type !== "string") { - console.error("Expected only a simple type."); - } else { - pushSimpleType(def.type); - } + const keys = Object.keys(def); + if (keys.length === 1 && keys[0] === "type") { + if (typeof def.type !== "string") { + console.error("Expected only a simple type."); } else { - schemas.push(def); + pushSimpleType(def.type); } + } else { + schemas.push(def); } } @@ -997,7 +1089,7 @@ export class JsonSchemaGenerator { if (schemas.length === 1) { for (const k in schemas[0]) { if (schemas[0].hasOwnProperty(k)) { - definition[k] = schemas[0][k]; + (definition as DefinitionIndex)[k] = schemas[0][k as keyof Definition]; } } } else { @@ -1022,9 +1114,9 @@ export class JsonSchemaGenerator { const clazz = node; const props = this.tc.getPropertiesOfType(clazzType).filter((prop) => { - // filter never - const propertyType = this.tc.getTypeOfSymbolAtLocation(prop, node); - if (ts.TypeFlags.Never === propertyType.getFlags()) { + // filter never and undefined + const propertyFlagType = this.tc.getTypeOfSymbolAtLocation(prop, node).getFlags(); + if (ts.TypeFlags.Never === propertyFlagType || ts.TypeFlags.Undefined === propertyFlagType) { return false; } if (!this.args.excludePrivate) { @@ -1035,8 +1127,8 @@ export class JsonSchemaGenerator { return !( decls && decls.filter((decl) => { - const mods = decl.modifiers; - return mods && mods.filter((mod) => mod.kind === ts.SyntaxKind.PrivateKeyword).length > 0; + const mods = (decl as any).modifiers; + return mods && mods.filter((mod: any) => mod.kind === ts.SyntaxKind.PrivateKeyword).length > 0; }).length > 0 ); }); @@ -1062,19 +1154,37 @@ export class JsonSchemaGenerator { } const indexSymbol: ts.Symbol = (indexSignature.parameters[0]).symbol; const indexType = this.tc.getTypeOfSymbolAtLocation(indexSymbol, node); - const isStringIndexed = indexType.flags === ts.TypeFlags.String; - if (indexType.flags !== ts.TypeFlags.Number && !isStringIndexed) { + 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" ); } const typ = this.tc.getTypeAtLocation(indexSignature.type!); - const def = this.getTypeDefinition(typ, undefined, "anyOf"); - - if (isStringIndexed) { + let def: Definition | undefined; + if (typ.flags & ts.TypeFlags.IndexedAccess) { + const targetName = ts.escapeLeadingUnderscores((clazzType).mapper?.target?.value); + const indexedAccessType = typ; + const symbols: Map = (indexedAccessType.objectType).members; + const targetSymbol = symbols?.get(targetName); + + if (targetSymbol) { + const targetNode = targetSymbol.getDeclarations()![0]; + const targetDef = this.getDefinitionForProperty(targetSymbol, targetNode); + if (targetDef) { + def = targetDef; + } + } + } + if (!def) { + def = this.getTypeDefinition(typ, undefined, "anyOf"); + } + if (isIndexedObject) { definition.type = "object"; - definition.additionalProperties = def; + if (!Object.keys(definition.patternProperties || {}).length) { + definition.additionalProperties = def; + } } else { definition.type = "array"; if (!definition.items) { @@ -1084,7 +1194,7 @@ export class JsonSchemaGenerator { } } - const propertyDefinitions = props.reduce((all, prop) => { + const propertyDefinitions = props.reduce>((all, prop) => { const propertyName = prop.getName(); const propDef = this.getDefinitionForProperty(prop, node); if (propDef != null) { @@ -1121,10 +1231,12 @@ 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) || []; if ( !(prop.flags & ts.SymbolFlags.Optional) && !(prop.flags & ts.SymbolFlags.Method) && - !(prop).mayBeUndefined && + !allUnionTypesFlags.includes(ts.TypeFlags.Undefined) && + !allUnionTypesFlags.includes(ts.TypeFlags.Void) && !def.hasOwnProperty("ignore") ) { required.push(prop.getName()); @@ -1181,10 +1293,12 @@ export class JsonSchemaGenerator { private getTypeDefinition( typ: ts.Type, asRef = this.args.ref, - unionModifier: string = "anyOf", + unionModifier: keyof Definition = "anyOf", prop?: ts.Symbol, reffedType?: ts.Symbol, - pairedSymbol?: ts.Symbol + pairedSymbol?: ts.Symbol, + forceNotRef: boolean = false, + ignoreUndefined = false, ): Definition { const definition: Definition = {}; // real definition @@ -1223,7 +1337,7 @@ export class JsonSchemaGenerator { const symbol = typ.getSymbol(); // FIXME: We can't just compare the name of the symbol - it ignores the namespace let isRawType = - !symbol || + !symbol || // Window is incorrectly marked as rawType here for some reason (this.tc.getFullyQualifiedName(symbol) !== "Window" && (this.tc.getFullyQualifiedName(symbol) === "Date" || @@ -1231,7 +1345,7 @@ export class JsonSchemaGenerator { this.tc.getIndexInfoOfType(typ, ts.IndexKind.Number) !== undefined)); if (isRawType && (typ as any).aliasSymbol?.escapedName && (typ as any).types) { - isRawType = false; + isRawType = false; } // special case: an union where all child are string literals -> make an enum instead @@ -1289,7 +1403,7 @@ export class JsonSchemaGenerator { // Handle recursive types if (!isRawType || !!typ.aliasSymbol) { - if (this.recursiveTypeRef.has(fullTypeName)) { + if (this.recursiveTypeRef.has(fullTypeName) && !forceNotRef) { asRef = true; } else { this.recursiveTypeRef.set(fullTypeName, definition); @@ -1305,7 +1419,7 @@ export class JsonSchemaGenerator { } // Parse comments - const otherAnnotations = {}; + const otherAnnotations: Record = {}; this.parseCommentsIntoDefinition(reffedType!, definition, otherAnnotations); // handle comments in the type alias declaration this.parseCommentsIntoDefinition(symbol!, definition, otherAnnotations); this.parseCommentsIntoDefinition(typ.aliasSymbol!, definition, otherAnnotations); @@ -1317,8 +1431,12 @@ export class JsonSchemaGenerator { } // Create the actual definition only if is an inline definition, or - // if it will be a $ref and it is not yet created - if (!asRef || !this.reffedDefinitions[fullTypeName]) { + // if it will be a $ref and it is not yet created. + // Prioritise overrides. + const overrideDefinition = this.schemaOverrides.get(fullTypeName); + if (overrideDefinition) { + this.reffedDefinitions[fullTypeName] = overrideDefinition; + } else if (!asRef || !this.reffedDefinitions[fullTypeName]) { if (asRef) { // must be here to prevent recursivity problems let reffedDefinition: Definition; @@ -1336,8 +1454,8 @@ export class JsonSchemaGenerator { if (definition.type === undefined) { // if users override the type, do not try to infer it - if (typ.flags & ts.TypeFlags.Union) { - this.getUnionDefinition(typ as ts.UnionType, prop!, unionModifier, definition); + if (typ.flags & ts.TypeFlags.Union && (node === null || node.kind !== ts.SyntaxKind.EnumDeclaration)) { + this.getUnionDefinition(typ as ts.UnionType, unionModifier, definition); } else if (typ.flags & ts.TypeFlags.Intersection) { if (this.args.noExtraProps) { // extend object instead of using allOf because allOf does not work well with additional properties. See #107 @@ -1347,12 +1465,13 @@ export class JsonSchemaGenerator { const types = (typ).types; for (const member of types) { - const other = this.getTypeDefinition(member, false); + const other = this.getTypeDefinition(member, false, undefined, undefined, undefined, undefined, true); definition.type = other.type; // should always be object definition.properties = { ...definition.properties, ...other.properties, }; + if (Object.keys(other.default || {}).length > 0) { definition.default = extend(definition.default || {}, other.default); } @@ -1367,7 +1486,7 @@ export class JsonSchemaGenerator { if (pairedSymbol) { this.parseCommentsIntoDefinition(pairedSymbol, definition, {}); } - this.getDefinitionForRootType(typ, reffedType!, definition); + this.getDefinitionForRootType(typ, reffedType!, definition, undefined, ignoreUndefined); } else if ( node && (node.kind === ts.SyntaxKind.EnumDeclaration || node.kind === ts.SyntaxKind.EnumMember) @@ -1392,8 +1511,8 @@ 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] && typeof value !== undefined) { + const annotations = Object.entries(returnedDefinition).reduce>((acc, [key, value]) => { + if (annotationKeywords[key as keyof typeof annotationKeywords] && typeof value !== undefined) { acc[key] = value; } return acc; @@ -1417,21 +1536,27 @@ export class JsonSchemaGenerator { this.schemaOverrides.set(symbolName, schema); } - public getSchemaForSymbol(symbolName: string, includeReffedDefinitions: boolean = true): Definition { - if (!this.allSymbols[symbolName]) { + 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`); } - this.resetSchemaSpecificProperties(); + this.resetSchemaSpecificProperties(includeAllOverrides); - const def = this.getTypeDefinition( - this.allSymbols[symbolName], - this.args.topRef, - undefined, - undefined, - undefined, - this.userSymbols[symbolName] || undefined - ); + let def; + if (overrideDefinition) { + def = { ...overrideDefinition }; + } else { + 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) { def.definitions = this.reffedDefinitions; @@ -1444,13 +1569,17 @@ export class JsonSchemaGenerator { return def; } - public getSchemaForSymbols(symbolNames: string[], includeReffedDefinitions: boolean = true): Definition { - const root = { + public getSchemaForSymbols(symbolNames: string[], includeReffedDefinitions: boolean = true, includeAllOverrides: boolean = false): Definition { + const root: { + $id?: string, + $schema: string, + definitions: Record + } = { $schema: "http://json-schema.org/draft-07/schema#", definitions: {}, }; - this.resetSchemaSpecificProperties(); + this.resetSchemaSpecificProperties(includeAllOverrides); const id = this.args.id; @@ -1554,7 +1683,7 @@ export function buildGenerator( for (const pref in args) { if (args.hasOwnProperty(pref)) { - settings[pref] = args[pref]; + (settings as Record[keyof Args]>)[pref as keyof Args] = args[pref as keyof Args]; } } @@ -1648,7 +1777,7 @@ export function generateSchema( if (fullTypeName === "*") { // All types in file(s) - return generator.getSchemaForSymbols(generator.getMainFileSymbols(program, onlyIncludeFiles)); + return generator.getSchemaForSymbols(generator.getMainFileSymbols(program, onlyIncludeFiles), true, true); } else if (args.uniqueNames) { // Find the hashed type name to use as the root object const matchingSymbols = generator.getSymbols(fullTypeName); @@ -1714,6 +1843,8 @@ export async function exec(filePattern: string, fullTypeName: string, args = get strictNullChecks: args.strictNullChecks, esModuleInterop: args.esModuleInterop, skipLibCheck: args.skipLibCheck, + emitDecoratorMetadata: args.experimentalDecorators, + experimentalDecorators: args.experimentalDecorators, }); onlyIncludeFiles = onlyIncludeFiles.map(normalizeFileName); } diff --git a/yarn.lock b/yarn.lock index 7482dd3b..c08d754d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,19 +4,19 @@ "@babel/code-frame@^7.0.0": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + 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.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" + 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.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + 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" @@ -25,24 +25,24 @@ "@cspotcode/source-map-support@^0.8.0": version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + 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.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + 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.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + 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.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" @@ -50,32 +50,32 @@ "@tsconfig/node10@^1.0.7": version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + 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.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + 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.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + 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.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" + 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.yarnpkg.com/@types/chai/-/chai-4.2.21.tgz#9f35a5643129df132cf3b5c1ec64046ea1af0650" + 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.yarnpkg.com/@types/glob/-/glob-7.1.4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672" + resolved "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz" integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== dependencies: "@types/minimatch" "*" @@ -83,49 +83,56 @@ "@types/json-schema@^7.0.9": version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + 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.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + 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.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz" integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== -"@types/node@*", "@types/node@^16.9.2": - version "16.9.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.2.tgz#81f5a039d6ed1941f8cc57506c74e7c2b8fc64b9" - integrity sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w== +"@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": + 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.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + 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.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + 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.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + 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.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + 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.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz" integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== dependencies: fast-deep-equal "^3.1.1" @@ -135,31 +142,31 @@ ajv@^8.0.0, ajv@^8.6.3: ansi-colors@4.1.1: version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + 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: version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + 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.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + 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.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + 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.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" @@ -167,39 +174,39 @@ anymatch@~3.1.2: arg@^4.1.0: version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + 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.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + 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.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + 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.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + 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.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + 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.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + 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.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -207,34 +214,34 @@ brace-expansion@^1.1.7: braces@~3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + 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.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + 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.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + 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.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + 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.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== chai@^4.3.4: version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + resolved "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz" integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== dependencies: assertion-error "^1.1.0" @@ -246,7 +253,7 @@ chai@^4.3.4: chalk@^2.0.0, chalk@^2.3.0: version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + 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" @@ -255,7 +262,7 @@ chalk@^2.0.0, chalk@^2.3.0: chalk@^4.1.0: version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" @@ -263,12 +270,12 @@ chalk@^4.1.0: check-error@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= chokidar@3.5.2: version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== dependencies: anymatch "~3.1.2" @@ -283,7 +290,7 @@ chokidar@3.5.2: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + 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" @@ -292,112 +299,112 @@ cliui@^7.0.2: color-convert@^1.9.0: version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + 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.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + 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.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + 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.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== commander@^2.12.1: version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + 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.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + 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.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + 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.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" decamelize@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + 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.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz" integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== dependencies: type-detect "^4.0.0" diff@5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + 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.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + 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.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + 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.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= esprima@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + 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.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + 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.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== dependencies: to-regex-range "^5.0.1" find-up@5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + 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" @@ -405,12 +412,12 @@ find-up@5.0.0: flat@^5.0.2: version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + 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.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@~2.3.2: @@ -420,29 +427,29 @@ fsevents@~2.3.2: function-bind@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + 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.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + 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.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: fs.realpath "^1.0.0" @@ -454,34 +461,34 @@ glob@7.1.7, glob@^7.1.1, glob@^7.1.7: growl@1.10.5: version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + 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.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + 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.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + 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.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" he@1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + 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.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" @@ -489,75 +496,75 @@ inflight@^1.0.4: inherits@2: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + 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.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + 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.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz" integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + 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.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + 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.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + 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.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + 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.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + 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.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + 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.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + 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.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + 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.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" @@ -565,19 +572,19 @@ js-yaml@^3.13.1: json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + 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.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + 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.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" @@ -585,31 +592,31 @@ log-symbols@4.1.0: make-error@^1.1.1: version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + 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.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@^1.2.5: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + version "1.2.5" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== mkdirp@^0.5.3: version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" mocha@^9.1.3: version "9.1.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + resolved "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz" integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== dependencies: "@ungap/promise-all-settled" "1.1.2" @@ -639,112 +646,112 @@ mocha@^9.1.3: ms@2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + 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.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + 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.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz" integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + 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.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + 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.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + 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.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + 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.1.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/path-equal/-/path-equal-1.2.2.tgz#fa2997f0a829de22ec8f5f86461ca5590d49b832" - integrity sha512-AUJvbcle1Zgb1TgtftHYknlrgrSYyI1ytrYgSbKUHSybwqUDnbD2cw9PIWivuMvsN+GTXmr/DRN4VBXpHG6aGg== +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.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + 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.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-parse@^1.0.6: version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + 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.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + 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.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== prettier@^2.4.1: version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== punycode@^2.1.0: version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + 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.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + 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.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + 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.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + 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.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: is-core-module "^2.2.0" @@ -752,29 +759,29 @@ resolve@^1.3.2: safe-buffer@^5.1.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + 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.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.2.0.tgz#26a52f13a6988de16a0d88e20248f38e8a7d840c" + resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.2.0.tgz" integrity sha512-C6AuMdYPuPV/P1leplHNu0lgc2LAElq/g3TdoksDCIVtBhr78o/CH03bt/9SKqugFbKU9CUjsNlCu0fjtQzQUw== semver@^5.3.0: version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== serialize-javascript@6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + 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.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== dependencies: buffer-from "^1.0.0" @@ -782,17 +789,17 @@ source-map-support@^0.5.20: source-map@^0.6.0: version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + 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.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + 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.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz" integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" @@ -801,47 +808,47 @@ string-width@^4.1.0, string-width@^4.2.0: strip-ansi@^6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz" integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== dependencies: ansi-regex "^5.0.0" strip-json-comments@3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + 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.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + 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.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + 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.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + 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" to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + 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.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: "@cspotcode/source-map-support" "^0.8.0" @@ -860,12 +867,12 @@ ts-node@^10.9.1: tslib@^1.13.0, tslib@^1.8.1: version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + 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.yarnpkg.com/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904" + resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg== dependencies: "@babel/code-frame" "^7.0.0" @@ -884,48 +891,53 @@ tslint@^6.1.3: tsutils@^2.29.0: version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + 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.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -typescript@~4.8.2: - version "4.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" - integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== +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.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + 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.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + 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.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + 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.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz" integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + 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" @@ -934,27 +946,22 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + 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.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + 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.4, yargs-parser@^20.2.2: version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-unparser@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" @@ -964,7 +971,7 @@ yargs-unparser@2.0.0: yargs@16.2.0: version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -977,7 +984,7 @@ yargs@16.2.0: yargs@^17.1.1: version "17.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.1.1.tgz#c2a8091564bdb196f7c0a67c1d12e5b85b8067ba" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz" integrity sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ== dependencies: cliui "^7.0.2" @@ -990,10 +997,10 @@ yargs@^17.1.1: yn@3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + 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.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==