@mirascript/typed 0.1.78 → 0.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/json/impl.d.ts +8 -0
- package/dist/json/impl.d.ts.map +1 -0
- package/dist/json/impl.js +51 -0
- package/dist/json/impl.js.map +1 -0
- package/dist/{json.d.ts → json/index.d.ts} +2 -2
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +17 -0
- package/dist/json/index.js.map +1 -0
- package/dist/json/literal.d.ts +9 -0
- package/dist/json/literal.d.ts.map +1 -0
- package/dist/json/literal.js +16 -0
- package/dist/json/literal.js.map +1 -0
- package/dist/json/record.d.ts +6 -0
- package/dist/json/record.d.ts.map +1 -0
- package/dist/json/record.js +66 -0
- package/dist/json/record.js.map +1 -0
- package/dist/json/string.d.ts +5 -0
- package/dist/json/string.d.ts.map +1 -0
- package/dist/json/string.js +28 -0
- package/dist/json/string.js.map +1 -0
- package/dist/json/template.d.ts +8 -0
- package/dist/json/template.d.ts.map +1 -0
- package/dist/json/template.js +72 -0
- package/dist/json/template.js.map +1 -0
- package/dist/json/tuple.d.ts +8 -0
- package/dist/json/tuple.d.ts.map +1 -0
- package/dist/json/tuple.js +52 -0
- package/dist/json/tuple.js.map +1 -0
- package/dist/json/union-intersection.d.ts +8 -0
- package/dist/json/union-intersection.d.ts.map +1 -0
- package/dist/json/union-intersection.js +40 -0
- package/dist/json/union-intersection.js.map +1 -0
- package/dist/simplifier/dedup.d.ts +4 -0
- package/dist/simplifier/dedup.d.ts.map +1 -0
- package/dist/simplifier/dedup.js +61 -0
- package/dist/simplifier/dedup.js.map +1 -0
- package/dist/simplifier/impl.d.ts +7 -0
- package/dist/simplifier/impl.d.ts.map +1 -0
- package/dist/simplifier/impl.js +51 -0
- package/dist/simplifier/impl.js.map +1 -0
- package/dist/{simplifier.d.ts → simplifier/index.d.ts} +3 -5
- package/dist/simplifier/index.d.ts.map +1 -0
- package/dist/simplifier/index.js +22 -0
- package/dist/simplifier/index.js.map +1 -0
- package/dist/simplifier/intersection.d.ts +5 -0
- package/dist/simplifier/intersection.d.ts.map +1 -0
- package/dist/simplifier/intersection.js +126 -0
- package/dist/simplifier/intersection.js.map +1 -0
- package/dist/simplifier/record.d.ts +5 -0
- package/dist/simplifier/record.d.ts.map +1 -0
- package/dist/simplifier/record.js +24 -0
- package/dist/simplifier/record.js.map +1 -0
- package/dist/simplifier/top-type.d.ts +5 -0
- package/dist/simplifier/top-type.d.ts.map +1 -0
- package/dist/simplifier/top-type.js +9 -0
- package/dist/simplifier/top-type.js.map +1 -0
- package/dist/simplifier/tuple.d.ts +5 -0
- package/dist/simplifier/tuple.d.ts.map +1 -0
- package/dist/simplifier/tuple.js +17 -0
- package/dist/simplifier/tuple.js.map +1 -0
- package/dist/simplifier/union.d.ts +5 -0
- package/dist/simplifier/union.d.ts.map +1 -0
- package/dist/simplifier/union.js +47 -0
- package/dist/simplifier/union.js.map +1 -0
- package/dist/simplifier/utils.d.ts +12 -0
- package/dist/simplifier/utils.d.ts.map +1 -0
- package/dist/simplifier/utils.js +17 -0
- package/dist/simplifier/utils.js.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +2 -2
- package/src/json/impl.ts +57 -0
- package/src/json/index.ts +28 -0
- package/src/json/literal.ts +20 -0
- package/src/json/record.ts +70 -0
- package/src/json/string.ts +30 -0
- package/src/json/template.ts +71 -0
- package/src/json/tuple.ts +52 -0
- package/src/json/union-intersection.ts +43 -0
- package/src/simplifier/dedup.ts +61 -0
- package/src/simplifier/impl.ts +64 -0
- package/src/simplifier/index.ts +67 -0
- package/src/simplifier/intersection.ts +129 -0
- package/src/simplifier/record.ts +24 -0
- package/src/simplifier/top-type.ts +9 -0
- package/src/simplifier/tuple.ts +20 -0
- package/src/simplifier/union.ts +45 -0
- package/src/simplifier/utils.ts +21 -0
- package/dist/json.d.ts.map +0 -1
- package/dist/json.js +0 -314
- package/dist/json.js.map +0 -1
- package/dist/simplifier.d.ts.map +0 -1
- package/dist/simplifier.js +0 -332
- package/dist/simplifier.js.map +0 -1
- package/src/json.ts +0 -323
- package/src/simplifier.ts +0 -404
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { Type } from '../parser.js';
|
|
3
|
+
import type { ToJSONSchemaOptions } from './index.js';
|
|
4
|
+
/** Options for toJSONSchemaImpl */
|
|
5
|
+
export type ToJSONSchemaOptionsImpl = Required<ToJSONSchemaOptions>;
|
|
6
|
+
/** Converts a Type object into JSON Schema */
|
|
7
|
+
export declare function toJSONSchemaImpl(type: Type, options: ToJSONSchemaOptionsImpl): JSONSchema;
|
|
8
|
+
//# sourceMappingURL=impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl.d.ts","sourceRoot":"","sources":["../../src/json/impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQtD,mCAAmC;AACnC,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAEpE,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAyCzF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { simplify } from '../simplifier/index.js';
|
|
2
|
+
import { string } from './string.js';
|
|
3
|
+
import { template } from './template.js';
|
|
4
|
+
import { tuple } from './tuple.js';
|
|
5
|
+
import { literal } from './literal.js';
|
|
6
|
+
import { record } from './record.js';
|
|
7
|
+
import { intersection, union } from './union-intersection.js';
|
|
8
|
+
/** Converts a Type object into JSON Schema */
|
|
9
|
+
export function toJSONSchemaImpl(type, options) {
|
|
10
|
+
const simplified = simplify(type);
|
|
11
|
+
if (typeof simplified == 'symbol') {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (typeof simplified == 'string') {
|
|
15
|
+
return string(simplified);
|
|
16
|
+
}
|
|
17
|
+
if (simplified.kind === 'array') {
|
|
18
|
+
return {
|
|
19
|
+
type: 'array',
|
|
20
|
+
items: toJSONSchemaImpl(simplified.element, options),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (simplified.kind === 'union') {
|
|
24
|
+
return union(simplified, options);
|
|
25
|
+
}
|
|
26
|
+
if (simplified.kind === 'intersection') {
|
|
27
|
+
return intersection(simplified, options);
|
|
28
|
+
}
|
|
29
|
+
if (simplified.kind === 'record') {
|
|
30
|
+
return record(simplified, options);
|
|
31
|
+
}
|
|
32
|
+
if (simplified.kind === 'literal') {
|
|
33
|
+
return literal(simplified);
|
|
34
|
+
}
|
|
35
|
+
if (simplified.kind === 'function') {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (simplified.kind === 'template') {
|
|
39
|
+
return template(simplified);
|
|
40
|
+
}
|
|
41
|
+
if (simplified.kind === 'tuple') {
|
|
42
|
+
return tuple(simplified, options);
|
|
43
|
+
}
|
|
44
|
+
if (simplified.kind === 'reflection') {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
/* c8 ignore next 3 */
|
|
48
|
+
simplified;
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl.js","sourceRoot":"","sources":["../../src/json/impl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAK9D,8CAA8C;AAC9C,MAAM,UAAU,gBAAgB,CAAC,IAAU,EAAE,OAAgC;IACzE,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,OAAO,UAAU,IAAI,QAAQ,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,OAAO,UAAU,IAAI,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,UAAU,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
-
import type { Type } from '
|
|
2
|
+
import type { Type } from '../parser.js';
|
|
3
3
|
export type { JSONSchema } from 'json-schema-typed';
|
|
4
4
|
/** Options for toJSONSchema */
|
|
5
5
|
export interface ToJSONSchemaOptions {
|
|
@@ -10,4 +10,4 @@ export interface ToJSONSchemaOptions {
|
|
|
10
10
|
export declare function toJSONSchema(type: Type, options?: ToJSONSchemaOptions): JSONSchema.Interface & {
|
|
11
11
|
$schema: typeof $schema;
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,+BAA+B;AAC/B,MAAM,WAAW,mBAAmB;IAChC,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,8CAA8C;AAC9C,wBAAgB,YAAY,CACxB,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,mBAAmB,GAC9B,UAAU,CAAC,SAAS,GAAG;IAAE,OAAO,EAAE,OAAO,OAAO,CAAA;CAAE,CAWpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $schema } from 'json-schema-typed';
|
|
2
|
+
import { toJSONSchemaImpl } from './impl.js';
|
|
3
|
+
/** Converts a Type object into JSON Schema */
|
|
4
|
+
export function toJSONSchema(type, options) {
|
|
5
|
+
let schema = toJSONSchemaImpl(type, { loose: options?.loose ?? false });
|
|
6
|
+
if (schema === true) {
|
|
7
|
+
schema = {};
|
|
8
|
+
}
|
|
9
|
+
else if (schema === false) {
|
|
10
|
+
schema = { not: true };
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
...schema,
|
|
14
|
+
$schema,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAU7C,8CAA8C;AAC9C,MAAM,UAAU,YAAY,CACxB,IAAU,EACV,OAA6B;IAE7B,IAAI,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;IACxE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,MAAM,GAAG,EAAE,CAAC;IAChB,CAAC;SAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO;QACH,GAAG,MAAM;QACT,OAAO;KACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { LiteralType, Type } from '../parser.js';
|
|
3
|
+
/** Converts a LiteralType into JSON Schema */
|
|
4
|
+
export declare function literal(type: LiteralType): JSONSchema;
|
|
5
|
+
/** Converts a union of LiteralTypes into a single JSON Schema enum */
|
|
6
|
+
export declare function literalEnum(types: LiteralType[]): JSONSchema;
|
|
7
|
+
/** Type guard for LiteralType */
|
|
8
|
+
export declare function isLiteralType(type: Type): type is LiteralType;
|
|
9
|
+
//# sourceMappingURL=literal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../src/json/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEtD,8CAA8C;AAC9C,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAErD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,UAAU,CAK5D;AAED,iCAAiC;AACjC,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,WAAW,CAE7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Converts a LiteralType into JSON Schema */
|
|
2
|
+
export function literal(type) {
|
|
3
|
+
return { const: type.value };
|
|
4
|
+
}
|
|
5
|
+
/** Converts a union of LiteralTypes into a single JSON Schema enum */
|
|
6
|
+
export function literalEnum(types) {
|
|
7
|
+
const schema = {
|
|
8
|
+
enum: types.map((t) => t.value),
|
|
9
|
+
};
|
|
10
|
+
return schema;
|
|
11
|
+
}
|
|
12
|
+
/** Type guard for LiteralType */
|
|
13
|
+
export function isLiteralType(type) {
|
|
14
|
+
return typeof type == 'object' && type.kind === 'literal';
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../src/json/literal.ts"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,MAAM,UAAU,OAAO,CAAC,IAAiB;IACrC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;AACjC,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,KAAoB;IAC5C,MAAM,MAAM,GAAe;QACvB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KAClC,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,aAAa,CAAC,IAAU;IACpC,OAAO,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { RecordType } from '../parser.js';
|
|
3
|
+
import { type ToJSONSchemaOptionsImpl } from './impl.js';
|
|
4
|
+
/** Converts a RecordType into JSON Schema */
|
|
5
|
+
export declare function record(simplified: RecordType, options: ToJSONSchemaOptionsImpl): JSONSchema;
|
|
6
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/json/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAe,UAAU,EAAQ,MAAM,cAAc,CAAC;AAClE,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,WAAW,CAAC;AA6D3E,6CAA6C;AAC7C,wBAAgB,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAK3F"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { toJSONSchemaImpl } from './impl.js';
|
|
2
|
+
import { templatePartPattern, RE_ANY } from './template.js';
|
|
3
|
+
import { isLiteralType } from './literal.js';
|
|
4
|
+
/** Convert fields record into JSON Schema */
|
|
5
|
+
function fieldsRecord(fields, options) {
|
|
6
|
+
const properties = {};
|
|
7
|
+
const required = [];
|
|
8
|
+
for (const field of fields) {
|
|
9
|
+
properties[field.name] = toJSONSchemaImpl(field.type, options);
|
|
10
|
+
if (!options.loose && !field.optional) {
|
|
11
|
+
required.push(field.name);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const schema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties,
|
|
17
|
+
additionalProperties: options.loose,
|
|
18
|
+
};
|
|
19
|
+
if (required.length > 0) {
|
|
20
|
+
schema.required = required;
|
|
21
|
+
}
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
24
|
+
/** Convert generic record into JSON Schema */
|
|
25
|
+
function genericRecord(key, value, options) {
|
|
26
|
+
const valueSchema = toJSONSchemaImpl(value, options);
|
|
27
|
+
if (typeof key == 'object') {
|
|
28
|
+
if (isLiteralType(key)) {
|
|
29
|
+
const schema = {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: { [String(key.value)]: valueSchema },
|
|
32
|
+
additionalProperties: options.loose,
|
|
33
|
+
};
|
|
34
|
+
return schema;
|
|
35
|
+
}
|
|
36
|
+
else if (key.kind === 'union' && key.types.every(isLiteralType)) {
|
|
37
|
+
const schema = {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: Object.fromEntries(key.types.map((t) => [String(t.value), valueSchema])),
|
|
40
|
+
additionalProperties: options.loose,
|
|
41
|
+
};
|
|
42
|
+
return schema;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const pattern = templatePartPattern(key, false);
|
|
46
|
+
if (pattern === RE_ANY) {
|
|
47
|
+
return {
|
|
48
|
+
type: 'object',
|
|
49
|
+
additionalProperties: valueSchema,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const schema = {
|
|
53
|
+
type: 'object',
|
|
54
|
+
patternProperties: { [`^${pattern}$`]: valueSchema },
|
|
55
|
+
additionalProperties: options.loose,
|
|
56
|
+
};
|
|
57
|
+
return schema;
|
|
58
|
+
}
|
|
59
|
+
/** Converts a RecordType into JSON Schema */
|
|
60
|
+
export function record(simplified, options) {
|
|
61
|
+
if ('fields' in simplified) {
|
|
62
|
+
return fieldsRecord(simplified.fields, options);
|
|
63
|
+
}
|
|
64
|
+
return genericRecord(simplified.key ?? 'string', simplified.value, options);
|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,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI,QAAQ,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { KnownType, NamedType } from '../parser.js';
|
|
3
|
+
/** Converts a KnownType or NamedType into JSON Schema */
|
|
4
|
+
export declare function string(type: KnownType | NamedType): JSONSchema;
|
|
5
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/json/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,yDAAyD;AACzD,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAyB9D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Converts a KnownType or NamedType into JSON Schema */
|
|
2
|
+
export function string(type) {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case 'string':
|
|
5
|
+
return { type: 'string' };
|
|
6
|
+
case 'number':
|
|
7
|
+
return { type: 'number' };
|
|
8
|
+
case 'boolean':
|
|
9
|
+
return { type: 'boolean' };
|
|
10
|
+
case 'nil':
|
|
11
|
+
return { type: 'null' };
|
|
12
|
+
case 'array':
|
|
13
|
+
return { type: 'array', items: true };
|
|
14
|
+
case 'record':
|
|
15
|
+
return { type: 'object' };
|
|
16
|
+
case 'extern':
|
|
17
|
+
return true;
|
|
18
|
+
case 'any':
|
|
19
|
+
return true;
|
|
20
|
+
case 'unknown':
|
|
21
|
+
return true;
|
|
22
|
+
case 'never':
|
|
23
|
+
return false;
|
|
24
|
+
default:
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/json/string.ts"],"names":[],"mappings":"AAGA,yDAAyD;AACzD,MAAM,UAAU,MAAM,CAAC,IAA2B;IAC9C,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,QAAQ;YACT,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC9B,KAAK,QAAQ;YACT,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC/B,KAAK,KAAK;YACN,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC5B,KAAK,OAAO;YACR,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC1C,KAAK,QAAQ;YACT,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC9B,KAAK,QAAQ;YACT,OAAO,IAAI,CAAC;QAChB,KAAK,KAAK;YACN,OAAO,IAAI,CAAC;QAChB,KAAK,SAAS;YACV,OAAO,IAAI,CAAC;QAChB,KAAK,OAAO;YACR,OAAO,KAAK,CAAC;QACjB;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { TemplateType, Type } from '../parser.js';
|
|
3
|
+
export declare const RE_ANY = ".*?";
|
|
4
|
+
/** Converts a template interpolation part into a regex pattern fragment */
|
|
5
|
+
export declare function templatePartPattern(part: Type, grouping: boolean): string;
|
|
6
|
+
/** Converts a TemplateType into a JSON Schema pattern */
|
|
7
|
+
export declare function template(type: TemplateType): JSONSchema;
|
|
8
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/json/template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOvD,eAAO,MAAM,MAAM,QAAQ,CAAC;AA0C5B,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAKzE;AAED,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAUvD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { REG_NUMBER } from '@mirascript/constants';
|
|
2
|
+
/** Escapes a literal string for use in a regular expression */
|
|
3
|
+
function escapeRegex(value) {
|
|
4
|
+
return value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
|
|
5
|
+
}
|
|
6
|
+
export const RE_ANY = '.*?';
|
|
7
|
+
const RE_NUMBER = REG_NUMBER.source;
|
|
8
|
+
const RE_BOOLEAN = 'true|false';
|
|
9
|
+
/** Converts a template interpolation part into a regex pattern fragment */
|
|
10
|
+
function templatePartPatternImpl(part) {
|
|
11
|
+
if (typeof part == 'symbol') {
|
|
12
|
+
return RE_ANY;
|
|
13
|
+
}
|
|
14
|
+
if (typeof part == 'string') {
|
|
15
|
+
if (part === 'number')
|
|
16
|
+
return RE_NUMBER;
|
|
17
|
+
if (part === 'boolean')
|
|
18
|
+
return RE_BOOLEAN;
|
|
19
|
+
if (part === 'nil' || part === 'never')
|
|
20
|
+
return '';
|
|
21
|
+
return RE_ANY;
|
|
22
|
+
}
|
|
23
|
+
if (part.kind === 'literal') {
|
|
24
|
+
if (typeof part.value === 'boolean') {
|
|
25
|
+
return String(part.value);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return escapeRegex(part.value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (part.kind === 'union') {
|
|
32
|
+
const patterns = new Set(part.types.map((p) => templatePartPatternImpl(p)));
|
|
33
|
+
if (patterns.has(RE_ANY)) {
|
|
34
|
+
return RE_ANY;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const hasEmpty = patterns.delete('');
|
|
38
|
+
let result = Array.from(patterns).join('|');
|
|
39
|
+
if (hasEmpty) {
|
|
40
|
+
result = `(${result})?`;
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (part.kind === 'intersection') {
|
|
46
|
+
// Regex intersection is not representable in general; keep behavior conservative.
|
|
47
|
+
return RE_ANY;
|
|
48
|
+
}
|
|
49
|
+
return RE_ANY;
|
|
50
|
+
}
|
|
51
|
+
/** Converts a template interpolation part into a regex pattern fragment */
|
|
52
|
+
export function templatePartPattern(part, grouping) {
|
|
53
|
+
const result = templatePartPatternImpl(part);
|
|
54
|
+
if (!grouping)
|
|
55
|
+
return result;
|
|
56
|
+
if (result.startsWith('('))
|
|
57
|
+
return result;
|
|
58
|
+
return `(${result})`;
|
|
59
|
+
}
|
|
60
|
+
/** Converts a TemplateType into a JSON Schema pattern */
|
|
61
|
+
export function template(type) {
|
|
62
|
+
const pattern = `^${type.parts
|
|
63
|
+
.map((p) => {
|
|
64
|
+
if (typeof p == 'object' && p.kind === 'literal' && typeof p.value === 'string') {
|
|
65
|
+
return templatePartPattern(p, false);
|
|
66
|
+
}
|
|
67
|
+
return templatePartPattern(p, true);
|
|
68
|
+
})
|
|
69
|
+
.join('')}$`;
|
|
70
|
+
return { type: 'string', pattern };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/json/template.ts"],"names":[],"mappings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C;IACxC,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;IACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { TupleType } from '../parser.js';
|
|
3
|
+
import { type ToJSONSchemaOptionsImpl } from './impl.js';
|
|
4
|
+
/**
|
|
5
|
+
* Converts a TupleType into JSON Schema
|
|
6
|
+
*/
|
|
7
|
+
export declare function tuple(tuple: TupleType, options: ToJSONSchemaOptionsImpl): JSONSchema;
|
|
8
|
+
//# sourceMappingURL=tuple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../src/json/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE3E;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CA4CpF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { toJSONSchemaImpl } from './impl.js';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a TupleType into JSON Schema
|
|
4
|
+
*/
|
|
5
|
+
export function tuple(tuple, options) {
|
|
6
|
+
// Collect element schemas, unwrapping array from rest elements (..T[] → T).
|
|
7
|
+
// Non-array rest (e.g. ..string) is treated as any ({}).
|
|
8
|
+
const elementSchemas = tuple.elements.map((e) => {
|
|
9
|
+
const t = e.type;
|
|
10
|
+
if (!e.spread)
|
|
11
|
+
return toJSONSchemaImpl(t, options);
|
|
12
|
+
if (typeof t == 'object' && t.kind === 'array') {
|
|
13
|
+
return toJSONSchemaImpl(t.element, options);
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
});
|
|
17
|
+
const prefixItems = [];
|
|
18
|
+
let i = 0;
|
|
19
|
+
for (; i < elementSchemas.length; i++) {
|
|
20
|
+
const el = tuple.elements[i];
|
|
21
|
+
if (el.spread)
|
|
22
|
+
break;
|
|
23
|
+
prefixItems.push(elementSchemas[i]);
|
|
24
|
+
}
|
|
25
|
+
const items = [];
|
|
26
|
+
let hasAny = false;
|
|
27
|
+
for (; i < elementSchemas.length; i++) {
|
|
28
|
+
const schema = elementSchemas[i];
|
|
29
|
+
items.push(schema);
|
|
30
|
+
if (schema === true) {
|
|
31
|
+
hasAny = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const schema = { type: 'array' };
|
|
35
|
+
if (prefixItems.length > 0) {
|
|
36
|
+
schema.prefixItems = prefixItems;
|
|
37
|
+
}
|
|
38
|
+
if (hasAny) {
|
|
39
|
+
schema.items = true;
|
|
40
|
+
}
|
|
41
|
+
else if (items.length > 1) {
|
|
42
|
+
schema.items = { anyOf: items };
|
|
43
|
+
}
|
|
44
|
+
else if (items.length === 1) {
|
|
45
|
+
schema.items = items[0];
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
schema.items = options.loose;
|
|
49
|
+
}
|
|
50
|
+
return schema;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=tuple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../src/json/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAgC,MAAM,WAAW,CAAC;AAE3E;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,KAAgB,EAAE,OAAgC;IACpE,4EAA4E;IAC5E,yDAAyD;IACzD,MAAM,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QA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M,CAAC,KAAK,GAAG,IAAI,CAAC;IACxB,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACpC,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IAC7B,CAAC;SAAM,CAAC;QACJ,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
import type { IntersectionType, UnionType } from '../parser.js';
|
|
3
|
+
import { type ToJSONSchemaOptionsImpl } from './impl.js';
|
|
4
|
+
/** Converts a union type to JSON representation */
|
|
5
|
+
export declare function union(union: UnionType, options: ToJSONSchemaOptionsImpl): JSONSchema;
|
|
6
|
+
/** Converts an intersection type to JSON representation */
|
|
7
|
+
export declare function intersection(intersection: IntersectionType, options: ToJSONSchemaOptionsImpl): JSONSchema;
|
|
8
|
+
//# sourceMappingURL=union-intersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union-intersection.d.ts","sourceRoot":"","sources":["../../src/json/union-intersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAe,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,WAAW,CAAC;AAG3E,mDAAmD;AACnD,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CA2BpF;AAED,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAMzG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { toJSONSchemaImpl } from './impl.js';
|
|
2
|
+
import { isLiteralType, literalEnum } from './literal.js';
|
|
3
|
+
/** Converts a union type to JSON representation */
|
|
4
|
+
export function union(union, options) {
|
|
5
|
+
const anyOf = [];
|
|
6
|
+
const literals = [];
|
|
7
|
+
for (const t of union.types) {
|
|
8
|
+
if (isLiteralType(t)) {
|
|
9
|
+
literals.push(t);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const child = toJSONSchemaImpl(t, options);
|
|
13
|
+
if (child === true) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (child === false) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
anyOf.push(child);
|
|
20
|
+
}
|
|
21
|
+
if (literals.length > 0) {
|
|
22
|
+
anyOf.push(literalEnum(literals));
|
|
23
|
+
}
|
|
24
|
+
if (anyOf.length === 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (anyOf.length === 1) {
|
|
28
|
+
return anyOf[0];
|
|
29
|
+
}
|
|
30
|
+
return { anyOf };
|
|
31
|
+
}
|
|
32
|
+
/** Converts an intersection type to JSON representation */
|
|
33
|
+
export function intersection(intersection, options) {
|
|
34
|
+
const allOf = intersection.types.map((t) => toJSONSchemaImpl(t, options));
|
|
35
|
+
if (allOf.length === 1) {
|
|
36
|
+
return allOf[0];
|
|
37
|
+
}
|
|
38
|
+
return { allOf };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=union-intersection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union-intersection.js","sourceRoot":"","sources":["../../src/json/union-intersection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO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,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC,CAAC,CAAE,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dedup.d.ts","sourceRoot":"","sources":["../../src/simplifier/dedup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AA+CzC,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAY5D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Builds a stable key for type-level deduplication within one simplify call. */
|
|
2
|
+
function getTypeDedupKey(type, symbols) {
|
|
3
|
+
if (typeof type === 'string')
|
|
4
|
+
return `string:${type}`;
|
|
5
|
+
if (typeof type === 'symbol') {
|
|
6
|
+
const existing = symbols.get(type);
|
|
7
|
+
if (existing != null)
|
|
8
|
+
return `symbol:${existing}`;
|
|
9
|
+
const next = symbols.size + 1;
|
|
10
|
+
symbols.set(type, next);
|
|
11
|
+
return `symbol:${next}`;
|
|
12
|
+
}
|
|
13
|
+
switch (type.kind) {
|
|
14
|
+
case 'array':
|
|
15
|
+
return `array:${getTypeDedupKey(type.element, symbols)}`;
|
|
16
|
+
case 'union':
|
|
17
|
+
return `union:[${type.types.map((t) => getTypeDedupKey(t, symbols)).join(',')}]`;
|
|
18
|
+
case 'intersection':
|
|
19
|
+
return `intersection:[${type.types.map((t) => getTypeDedupKey(t, symbols)).join(',')}]`;
|
|
20
|
+
case 'record':
|
|
21
|
+
if ('fields' in type) {
|
|
22
|
+
return `recordFields:[${type.fields
|
|
23
|
+
.map((f) => `${f.name}:${String(Boolean(f.optional))}:${getTypeDedupKey(f.type, symbols)}`)
|
|
24
|
+
.join(',')}]`;
|
|
25
|
+
}
|
|
26
|
+
return `recordKV:${type.key == null ? 'none' : getTypeDedupKey(type.key, symbols)}:${getTypeDedupKey(type.value, symbols)}`;
|
|
27
|
+
case 'literal':
|
|
28
|
+
return `literal:${typeof type.value}:${String(type.value)}`;
|
|
29
|
+
case 'template':
|
|
30
|
+
return `template:[${type.parts.map((p) => getTypeDedupKey(p, symbols)).join(',')}]`;
|
|
31
|
+
case 'function':
|
|
32
|
+
return `function:${type.name ?? ''}:<${(type.typeParams ?? []).map((p) => getTypeDedupKey(p, symbols)).join(',')}>(${type.params
|
|
33
|
+
.map((p) => `${p.name}:${String(Boolean(p.spread))}:${getTypeDedupKey(p.type, symbols)}`)
|
|
34
|
+
.join(',')})=>${type.returns == null ? 'void' : getTypeDedupKey(type.returns, symbols)}`;
|
|
35
|
+
case 'tuple':
|
|
36
|
+
return `tuple:[${type.elements
|
|
37
|
+
.map((e) => `${String(Boolean(e.spread))}:${getTypeDedupKey(e.type, symbols)}`)
|
|
38
|
+
.join(',')}]`;
|
|
39
|
+
case 'reflection':
|
|
40
|
+
return `reflection:${type.name}`;
|
|
41
|
+
default:
|
|
42
|
+
return 'unknown';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** Removes duplicate members from union/intersection type member lists. */
|
|
46
|
+
export function deduplicateTypeMembers(types) {
|
|
47
|
+
if (types.length <= 1)
|
|
48
|
+
return types;
|
|
49
|
+
const symbols = new Map();
|
|
50
|
+
const seen = new Set();
|
|
51
|
+
const result = [];
|
|
52
|
+
for (const type of types) {
|
|
53
|
+
const key = getTypeDedupKey(type, symbols);
|
|
54
|
+
if (seen.has(key))
|
|
55
|
+
continue;
|
|
56
|
+
seen.add(key);
|
|
57
|
+
result.push(type);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=dedup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dedup.js","sourceRoot":"","sources":["../../src/simplifier/dedup.ts"],"names":[],"mappings":"AAEA,iFAA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C,EAAE,CAAC;QACjG,KAAK,OAAO;YACR,OAAO,UAAU,IAAI,CAAC,QAAQ;iBACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBAC9E,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QACtB,KAAK,YAAY;YACb,OAAO,cAAc,IAAI,CAAC,IAAI,EAAE,CAAC;QACrC;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAChD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAW,EAAE,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Type } from '../parser.js';
|
|
2
|
+
import type { SimplifyOptions } from './index.js';
|
|
3
|
+
/** Options for simplifyImpl */
|
|
4
|
+
export type SimplifyImplOptions = Required<SimplifyOptions>;
|
|
5
|
+
/** Simplifies a Type AST in place, optionally disabling individual normalization passes. */
|
|
6
|
+
export declare function simplifyImpl(type: Type, options: SimplifyImplOptions): Type;
|
|
7
|
+
//# sourceMappingURL=impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impl.d.ts","sourceRoot":"","sources":["../../src/simplifier/impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,+BAA+B;AAC/B,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAE5D,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAoD3E"}
|