eslint-plugin-package-json 1.5.0 → 1.6.1

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.
Files changed (156) hide show
  1. package/README.md +107 -106
  2. package/{lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.mts → dist/createRule-29pC9RoP.d.mts} +49 -4
  3. package/dist/experimental/index.d.mts +68 -0
  4. package/{lib/experimental/plugin.mjs → dist/experimental/index.mjs} +10 -5
  5. package/dist/index.d.mts +99 -0
  6. package/{lib → dist}/index.mjs +1 -1
  7. package/dist/plugin-C-Z8sf5g.mjs +1737 -0
  8. package/package.json +33 -27
  9. package/lib/createRule.d.mts +0 -59
  10. package/lib/createRule.mjs +0 -24
  11. package/lib/experimental/index.d.mts +0 -34
  12. package/lib/experimental/index.mjs +0 -7
  13. package/lib/experimental/plugin.d.mts +0 -40
  14. package/lib/index.d.mts +0 -49
  15. package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +0 -438
  16. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.mts +0 -7
  17. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.mts +0 -20
  18. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.mts +0 -11
  19. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.mts +0 -16
  20. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.mts +0 -13
  21. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.mts +0 -14
  22. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.mts +0 -58
  23. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.mts +0 -14
  24. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.mts +0 -13
  25. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.mts +0 -14
  26. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.mts +0 -20
  27. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/index.d.mts +0 -34
  28. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/multipleTypes.d.mts +0 -14
  29. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/not.d.mts +0 -20
  30. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/nullable.d.mts +0 -14
  31. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/object.d.mts +0 -34
  32. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/oneOf.d.mts +0 -14
  33. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.mts +0 -22
  34. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/index.d.mts +0 -13
  35. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/internal.d.mts +0 -8
  36. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.mts +0 -12
  37. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/singleType.d.mts +0 -24
  38. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/utils.d.mts +0 -20
  39. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/and.d.mts +0 -4
  40. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/extends.d.mts +0 -4
  41. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/get.d.mts +0 -4
  42. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/join.d.mts +0 -4
  43. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/not.d.mts +0 -4
  44. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/pop.d.mts +0 -4
  45. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/split.d.mts +0 -7
  46. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.mts +0 -4
  47. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.mts +0 -4
  48. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +0 -20
  49. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +0 -28
  50. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +0 -25
  51. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +0 -25
  52. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +0 -16
  53. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +0 -20
  54. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +0 -28
  55. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +0 -23
  56. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +0 -24
  57. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +0 -44
  58. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +0 -16
  59. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +0 -43
  60. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +0 -13
  61. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +0 -35
  62. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +0 -23
  63. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +0 -24
  64. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +0 -34
  65. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +0 -26
  66. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +0 -24
  67. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +0 -25
  68. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +0 -23
  69. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +0 -26
  70. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +0 -17
  71. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +0 -10
  72. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +0 -9
  73. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +0 -49
  74. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +0 -26
  75. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +0 -22
  76. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +0 -36
  77. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +0 -18
  78. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +0 -23
  79. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +0 -7
  80. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +0 -4
  81. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +0 -7
  82. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +0 -4
  83. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +0 -4
  84. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +0 -4
  85. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +0 -6
  86. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +0 -4
  87. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +0 -4
  88. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +0 -6
  89. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +0 -4
  90. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +0 -6
  91. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +0 -6
  92. package/lib/plugin.d.mts +0 -56
  93. package/lib/plugin.mjs +0 -93
  94. package/lib/rules/bin-name-casing.d.mts +0 -6
  95. package/lib/rules/bin-name-casing.mjs +0 -41
  96. package/lib/rules/exports-subpaths-style.d.mts +0 -18
  97. package/lib/rules/exports-subpaths-style.mjs +0 -71
  98. package/lib/rules/no-empty-fields.d.mts +0 -20
  99. package/lib/rules/no-empty-fields.mjs +0 -90
  100. package/lib/rules/no-local-dependencies.d.mts +0 -17
  101. package/lib/rules/no-local-dependencies.mjs +0 -47
  102. package/lib/rules/no-redundant-files.d.mts +0 -6
  103. package/lib/rules/no-redundant-files.mjs +0 -100
  104. package/lib/rules/no-redundant-publishConfig.d.mts +0 -6
  105. package/lib/rules/no-redundant-publishConfig.mjs +0 -50
  106. package/lib/rules/order-properties.d.mts +0 -25
  107. package/lib/rules/order-properties.mjs +0 -64
  108. package/lib/rules/repository-shorthand.d.mts +0 -18
  109. package/lib/rules/repository-shorthand.mjs +0 -111
  110. package/lib/rules/require-attribution.d.mts +0 -22
  111. package/lib/rules/require-attribution.mjs +0 -91
  112. package/lib/rules/require-properties.d.mts +0 -22
  113. package/lib/rules/require-properties.mjs +0 -74
  114. package/lib/rules/restrict-dependency-ranges.d.mts +0 -92
  115. package/lib/rules/restrict-dependency-ranges.mjs +0 -147
  116. package/lib/rules/restrict-private-properties.d.mts +0 -20
  117. package/lib/rules/restrict-private-properties.mjs +0 -53
  118. package/lib/rules/restrict-top-level-properties.d.mts +0 -39
  119. package/lib/rules/restrict-top-level-properties.mjs +0 -73
  120. package/lib/rules/scripts-name-casing.d.mts +0 -6
  121. package/lib/rules/scripts-name-casing.mjs +0 -44
  122. package/lib/rules/sort-collections.d.mts +0 -35
  123. package/lib/rules/sort-collections.mjs +0 -111
  124. package/lib/rules/specify-peers-locally.d.mts +0 -6
  125. package/lib/rules/specify-peers-locally.mjs +0 -63
  126. package/lib/rules/unique-dependencies.d.mts +0 -6
  127. package/lib/rules/unique-dependencies.mjs +0 -87
  128. package/lib/rules/valid-author.d.mts +0 -6
  129. package/lib/rules/valid-author.mjs +0 -59
  130. package/lib/rules/valid-peerDependenciesMeta-relationship.d.mts +0 -6
  131. package/lib/rules/valid-peerDependenciesMeta-relationship.mjs +0 -50
  132. package/lib/rules/valid-properties.d.mts +0 -9
  133. package/lib/rules/valid-properties.mjs +0 -57
  134. package/lib/rules/valid-repository-directory.d.mts +0 -6
  135. package/lib/rules/valid-repository-directory.mjs +0 -73
  136. package/lib/types/estree.d.mts +0 -8
  137. package/lib/utils/createSimpleRequirePropertyRule.d.mts +0 -48
  138. package/lib/utils/createSimpleRequirePropertyRule.mjs +0 -62
  139. package/lib/utils/createSimpleValidPropertyRule.d.mts +0 -17
  140. package/lib/utils/createSimpleValidPropertyRule.mjs +0 -57
  141. package/lib/utils/findPropertyWithKeyValue.d.mts +0 -10
  142. package/lib/utils/findPropertyWithKeyValue.mjs +0 -6
  143. package/lib/utils/formatErrors.d.mts +0 -9
  144. package/lib/utils/formatErrors.mjs +0 -12
  145. package/lib/utils/git/getGitAuthor.d.mts +0 -8
  146. package/lib/utils/git/getGitAuthor.mjs +0 -29
  147. package/lib/utils/git/index.d.mts +0 -2
  148. package/lib/utils/git/index.mjs +0 -2
  149. package/lib/utils/predicates/index.d.mts +0 -4
  150. package/lib/utils/predicates/index.mjs +0 -4
  151. package/lib/utils/predicates/isJSONStringLiteral.d.mts +0 -6
  152. package/lib/utils/predicates/isJSONStringLiteral.mjs +0 -6
  153. package/lib/utils/predicates/isNotNullish.d.mts +0 -4
  154. package/lib/utils/predicates/isNotNullish.mjs +0 -6
  155. package/lib/utils/predicates/isPackageJson.d.mts +0 -4
  156. package/lib/utils/predicates/isPackageJson.mjs +0 -4
@@ -1,438 +0,0 @@
1
- //#region node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
2
- // This definition file follows a somewhat unusual format. ESTree allows
3
- // runtime type checks based on the `type` parameter. In order to explain this
4
- // to typescript we want to use discriminated union types:
5
- // https://github.com/Microsoft/TypeScript/pull/9163
6
- //
7
- // For ESTree this is a bit tricky because the high level interfaces like
8
- // Node or Function are pulling double duty. We want to pass common fields down
9
- // to the interfaces that extend them (like Identifier or
10
- // ArrowFunctionExpression), but you can't extend a type union or enforce
11
- // common fields on them. So we've split the high level interfaces into two
12
- // types, a base type which passes down inherited fields, and a type union of
13
- // all types which extend the base type. Only the type union is exported, and
14
- // the union is how other types refer to the collection of inheriting types.
15
- //
16
- // This makes the definitions file here somewhat more difficult to maintain,
17
- // but it has the notable advantage of making ESTree much easier to use as
18
- // an end user.
19
- interface BaseNodeWithoutComments {
20
- // Every leaf interface that extends BaseNode must specify a type property.
21
- // The type property should be a string literal. For example, Identifier
22
- // has: `type: "Identifier"`
23
- type: string;
24
- loc?: SourceLocation | null | undefined;
25
- range?: [number, number] | undefined;
26
- }
27
- interface BaseNode extends BaseNodeWithoutComments {
28
- leadingComments?: Comment[] | undefined;
29
- trailingComments?: Comment[] | undefined;
30
- }
31
- interface Comment extends BaseNodeWithoutComments {
32
- type: "Line" | "Block";
33
- value: string;
34
- }
35
- interface SourceLocation {
36
- source?: string | null | undefined;
37
- start: Position;
38
- end: Position;
39
- }
40
- interface Position {
41
- /** >= 1 */
42
- line: number;
43
- /** >= 0 */
44
- column: number;
45
- }
46
- interface BaseFunction extends BaseNode {
47
- params: Pattern[];
48
- generator?: boolean | undefined;
49
- async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
50
- // can have a body that's either. FunctionDeclarations and
51
- // FunctionExpressions have only BlockStatement bodies.
52
- body: BlockStatement | Expression;
53
- }
54
- type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
55
- interface BaseStatement extends BaseNode {}
56
- interface EmptyStatement extends BaseStatement {
57
- type: "EmptyStatement";
58
- }
59
- interface BlockStatement extends BaseStatement {
60
- type: "BlockStatement";
61
- body: Statement[];
62
- innerComments?: Comment[] | undefined;
63
- }
64
- interface StaticBlock extends Omit<BlockStatement, "type"> {
65
- type: "StaticBlock";
66
- }
67
- interface ExpressionStatement extends BaseStatement {
68
- type: "ExpressionStatement";
69
- expression: Expression;
70
- }
71
- interface IfStatement extends BaseStatement {
72
- type: "IfStatement";
73
- test: Expression;
74
- consequent: Statement;
75
- alternate?: Statement | null | undefined;
76
- }
77
- interface LabeledStatement extends BaseStatement {
78
- type: "LabeledStatement";
79
- label: Identifier;
80
- body: Statement;
81
- }
82
- interface BreakStatement extends BaseStatement {
83
- type: "BreakStatement";
84
- label?: Identifier | null | undefined;
85
- }
86
- interface ContinueStatement extends BaseStatement {
87
- type: "ContinueStatement";
88
- label?: Identifier | null | undefined;
89
- }
90
- interface WithStatement extends BaseStatement {
91
- type: "WithStatement";
92
- object: Expression;
93
- body: Statement;
94
- }
95
- interface SwitchStatement extends BaseStatement {
96
- type: "SwitchStatement";
97
- discriminant: Expression;
98
- cases: SwitchCase[];
99
- }
100
- interface ReturnStatement extends BaseStatement {
101
- type: "ReturnStatement";
102
- argument?: Expression | null | undefined;
103
- }
104
- interface ThrowStatement extends BaseStatement {
105
- type: "ThrowStatement";
106
- argument: Expression;
107
- }
108
- interface TryStatement extends BaseStatement {
109
- type: "TryStatement";
110
- block: BlockStatement;
111
- handler?: CatchClause | null | undefined;
112
- finalizer?: BlockStatement | null | undefined;
113
- }
114
- interface WhileStatement extends BaseStatement {
115
- type: "WhileStatement";
116
- test: Expression;
117
- body: Statement;
118
- }
119
- interface DoWhileStatement extends BaseStatement {
120
- type: "DoWhileStatement";
121
- body: Statement;
122
- test: Expression;
123
- }
124
- interface ForStatement extends BaseStatement {
125
- type: "ForStatement";
126
- init?: VariableDeclaration | Expression | null | undefined;
127
- test?: Expression | null | undefined;
128
- update?: Expression | null | undefined;
129
- body: Statement;
130
- }
131
- interface BaseForXStatement extends BaseStatement {
132
- left: VariableDeclaration | Pattern;
133
- right: Expression;
134
- body: Statement;
135
- }
136
- interface ForInStatement extends BaseForXStatement {
137
- type: "ForInStatement";
138
- }
139
- interface DebuggerStatement extends BaseStatement {
140
- type: "DebuggerStatement";
141
- }
142
- type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
143
- interface BaseDeclaration extends BaseStatement {}
144
- interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
145
- type: "FunctionDeclaration";
146
- /** It is null when a function declaration is a part of the `export default function` statement */
147
- id: Identifier | null;
148
- body: BlockStatement;
149
- }
150
- interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
151
- id: Identifier;
152
- }
153
- interface VariableDeclaration extends BaseDeclaration {
154
- type: "VariableDeclaration";
155
- declarations: VariableDeclarator[];
156
- kind: "var" | "let" | "const" | "using" | "await using";
157
- }
158
- interface VariableDeclarator extends BaseNode {
159
- type: "VariableDeclarator";
160
- id: Pattern;
161
- init?: Expression | null | undefined;
162
- }
163
- interface ExpressionMap {
164
- ArrayExpression: ArrayExpression;
165
- ArrowFunctionExpression: ArrowFunctionExpression;
166
- AssignmentExpression: AssignmentExpression;
167
- AwaitExpression: AwaitExpression;
168
- BinaryExpression: BinaryExpression;
169
- CallExpression: CallExpression;
170
- ChainExpression: ChainExpression;
171
- ClassExpression: ClassExpression;
172
- ConditionalExpression: ConditionalExpression;
173
- FunctionExpression: FunctionExpression;
174
- Identifier: Identifier;
175
- ImportExpression: ImportExpression;
176
- Literal: Literal;
177
- LogicalExpression: LogicalExpression;
178
- MemberExpression: MemberExpression;
179
- MetaProperty: MetaProperty;
180
- NewExpression: NewExpression;
181
- ObjectExpression: ObjectExpression;
182
- SequenceExpression: SequenceExpression;
183
- TaggedTemplateExpression: TaggedTemplateExpression;
184
- TemplateLiteral: TemplateLiteral;
185
- ThisExpression: ThisExpression;
186
- UnaryExpression: UnaryExpression;
187
- UpdateExpression: UpdateExpression;
188
- YieldExpression: YieldExpression;
189
- }
190
- type Expression = ExpressionMap[keyof ExpressionMap];
191
- interface BaseExpression extends BaseNode {}
192
- type ChainElement = SimpleCallExpression | MemberExpression;
193
- interface ChainExpression extends BaseExpression {
194
- type: "ChainExpression";
195
- expression: ChainElement;
196
- }
197
- interface ThisExpression extends BaseExpression {
198
- type: "ThisExpression";
199
- }
200
- interface ArrayExpression extends BaseExpression {
201
- type: "ArrayExpression";
202
- elements: Array<Expression | SpreadElement | null>;
203
- }
204
- interface ObjectExpression extends BaseExpression {
205
- type: "ObjectExpression";
206
- properties: Array<Property | SpreadElement>;
207
- }
208
- interface PrivateIdentifier extends BaseNode {
209
- type: "PrivateIdentifier";
210
- name: string;
211
- }
212
- interface Property extends BaseNode {
213
- type: "Property";
214
- key: Expression | PrivateIdentifier;
215
- value: Expression | Pattern; // Could be an AssignmentProperty
216
- kind: "init" | "get" | "set";
217
- method: boolean;
218
- shorthand: boolean;
219
- computed: boolean;
220
- }
221
- interface PropertyDefinition extends BaseNode {
222
- type: "PropertyDefinition";
223
- key: Expression | PrivateIdentifier;
224
- value?: Expression | null | undefined;
225
- computed: boolean;
226
- static: boolean;
227
- }
228
- interface FunctionExpression extends BaseFunction, BaseExpression {
229
- id?: Identifier | null | undefined;
230
- type: "FunctionExpression";
231
- body: BlockStatement;
232
- }
233
- interface SequenceExpression extends BaseExpression {
234
- type: "SequenceExpression";
235
- expressions: Expression[];
236
- }
237
- interface UnaryExpression extends BaseExpression {
238
- type: "UnaryExpression";
239
- operator: UnaryOperator;
240
- prefix: true;
241
- argument: Expression;
242
- }
243
- interface BinaryExpression extends BaseExpression {
244
- type: "BinaryExpression";
245
- operator: BinaryOperator;
246
- left: Expression | PrivateIdentifier;
247
- right: Expression;
248
- }
249
- interface AssignmentExpression extends BaseExpression {
250
- type: "AssignmentExpression";
251
- operator: AssignmentOperator;
252
- left: Pattern | MemberExpression;
253
- right: Expression;
254
- }
255
- interface UpdateExpression extends BaseExpression {
256
- type: "UpdateExpression";
257
- operator: UpdateOperator;
258
- argument: Expression;
259
- prefix: boolean;
260
- }
261
- interface LogicalExpression extends BaseExpression {
262
- type: "LogicalExpression";
263
- operator: LogicalOperator;
264
- left: Expression;
265
- right: Expression;
266
- }
267
- interface ConditionalExpression extends BaseExpression {
268
- type: "ConditionalExpression";
269
- test: Expression;
270
- alternate: Expression;
271
- consequent: Expression;
272
- }
273
- interface BaseCallExpression extends BaseExpression {
274
- callee: Expression | Super;
275
- arguments: Array<Expression | SpreadElement>;
276
- }
277
- type CallExpression = SimpleCallExpression | NewExpression;
278
- interface SimpleCallExpression extends BaseCallExpression {
279
- type: "CallExpression";
280
- optional: boolean;
281
- }
282
- interface NewExpression extends BaseCallExpression {
283
- type: "NewExpression";
284
- }
285
- interface MemberExpression extends BaseExpression, BasePattern {
286
- type: "MemberExpression";
287
- object: Expression | Super;
288
- property: Expression | PrivateIdentifier;
289
- computed: boolean;
290
- optional: boolean;
291
- }
292
- type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
293
- interface BasePattern extends BaseNode {}
294
- interface SwitchCase extends BaseNode {
295
- type: "SwitchCase";
296
- test?: Expression | null | undefined;
297
- consequent: Statement[];
298
- }
299
- interface CatchClause extends BaseNode {
300
- type: "CatchClause";
301
- param: Pattern | null;
302
- body: BlockStatement;
303
- }
304
- interface Identifier extends BaseNode, BaseExpression, BasePattern {
305
- type: "Identifier";
306
- name: string;
307
- }
308
- type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
309
- interface SimpleLiteral extends BaseNode, BaseExpression {
310
- type: "Literal";
311
- value: string | boolean | number | null;
312
- raw?: string | undefined;
313
- }
314
- interface RegExpLiteral extends BaseNode, BaseExpression {
315
- type: "Literal";
316
- value?: RegExp | null | undefined;
317
- regex: {
318
- pattern: string;
319
- flags: string;
320
- };
321
- raw?: string | undefined;
322
- }
323
- interface BigIntLiteral extends BaseNode, BaseExpression {
324
- type: "Literal";
325
- value?: bigint | null | undefined;
326
- bigint: string;
327
- raw?: string | undefined;
328
- }
329
- type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
330
- type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
331
- type LogicalOperator = "||" | "&&" | "??";
332
- type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
333
- type UpdateOperator = "++" | "--";
334
- interface ForOfStatement extends BaseForXStatement {
335
- type: "ForOfStatement";
336
- await: boolean;
337
- }
338
- interface Super extends BaseNode {
339
- type: "Super";
340
- }
341
- interface SpreadElement extends BaseNode {
342
- type: "SpreadElement";
343
- argument: Expression;
344
- }
345
- interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
346
- type: "ArrowFunctionExpression";
347
- expression: boolean;
348
- body: BlockStatement | Expression;
349
- }
350
- interface YieldExpression extends BaseExpression {
351
- type: "YieldExpression";
352
- argument?: Expression | null | undefined;
353
- delegate: boolean;
354
- }
355
- interface TemplateLiteral extends BaseExpression {
356
- type: "TemplateLiteral";
357
- quasis: TemplateElement[];
358
- expressions: Expression[];
359
- }
360
- interface TaggedTemplateExpression extends BaseExpression {
361
- type: "TaggedTemplateExpression";
362
- tag: Expression;
363
- quasi: TemplateLiteral;
364
- }
365
- interface TemplateElement extends BaseNode {
366
- type: "TemplateElement";
367
- tail: boolean;
368
- value: {
369
- /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
370
- raw: string;
371
- };
372
- }
373
- interface AssignmentProperty extends Property {
374
- value: Pattern;
375
- kind: "init";
376
- method: boolean; // false
377
- }
378
- interface ObjectPattern extends BasePattern {
379
- type: "ObjectPattern";
380
- properties: Array<AssignmentProperty | RestElement>;
381
- }
382
- interface ArrayPattern extends BasePattern {
383
- type: "ArrayPattern";
384
- elements: Array<Pattern | null>;
385
- }
386
- interface RestElement extends BasePattern {
387
- type: "RestElement";
388
- argument: Pattern;
389
- }
390
- interface AssignmentPattern extends BasePattern {
391
- type: "AssignmentPattern";
392
- left: Pattern;
393
- right: Expression;
394
- }
395
- interface BaseClass extends BaseNode {
396
- superClass?: Expression | null | undefined;
397
- body: ClassBody;
398
- }
399
- interface ClassBody extends BaseNode {
400
- type: "ClassBody";
401
- body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
402
- }
403
- interface MethodDefinition extends BaseNode {
404
- type: "MethodDefinition";
405
- key: Expression | PrivateIdentifier;
406
- value: FunctionExpression;
407
- kind: "constructor" | "method" | "get" | "set";
408
- computed: boolean;
409
- static: boolean;
410
- }
411
- interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
412
- type: "ClassDeclaration";
413
- /** It is null when a class declaration is a part of the `export default class` statement */
414
- id: Identifier | null;
415
- }
416
- interface ClassDeclaration extends MaybeNamedClassDeclaration {
417
- id: Identifier;
418
- }
419
- interface ClassExpression extends BaseClass, BaseExpression {
420
- type: "ClassExpression";
421
- id?: Identifier | null | undefined;
422
- }
423
- interface MetaProperty extends BaseExpression {
424
- type: "MetaProperty";
425
- meta: Identifier;
426
- property: Identifier;
427
- }
428
- interface ImportExpression extends BaseExpression {
429
- type: "ImportExpression";
430
- source: Expression;
431
- options?: Expression | null | undefined;
432
- }
433
- interface AwaitExpression extends BaseExpression {
434
- type: "AwaitExpression";
435
- argument: Expression;
436
- }
437
- //#endregion
438
- export { Expression, ExpressionStatement };
@@ -1,7 +0,0 @@
1
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.ts
2
- type DeserializationPattern = Readonly<{
3
- pattern: unknown;
4
- output: unknown;
5
- }>;
6
- //#endregion
7
- export { DeserializationPattern };
@@ -1,20 +0,0 @@
1
- import { DeserializationPattern } from "./deserializationPattern.mjs";
2
- import { JSONSchemaReference } from "./jsonSchema.mjs";
3
-
4
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.ts
5
- type FromSchemaOptions = {
6
- parseNotKeyword?: boolean;
7
- parseIfThenElseKeywords?: boolean;
8
- keepDefaultedPropertiesOptional?: boolean;
9
- references?: JSONSchemaReference[] | false;
10
- deserialize?: DeserializationPattern[] | false;
11
- };
12
- type FromSchemaDefaultOptions = {
13
- parseNotKeyword: false;
14
- parseIfThenElseKeywords: false;
15
- keepDefaultedPropertiesOptional: false;
16
- references: false;
17
- deserialize: false;
18
- };
19
- //#endregion
20
- export { FromSchemaDefaultOptions, FromSchemaOptions };
@@ -1,11 +0,0 @@
1
- import { $Resolve } from "../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.mjs";
2
- import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
3
- import { JSONSchema } from "./definitions/jsonSchema.mjs";
4
- import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
5
- import { ParseOptions } from "./parse-options.mjs";
6
- import { ParseSchema } from "./parse-schema/index.mjs";
7
-
8
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.ts
9
- type FromSchema<SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions = FromSchemaDefaultOptions> = $Resolve<ParseSchema<SCHEMA, ParseOptions<SCHEMA, OPTIONS>>>;
10
- //#endregion
11
- export { FromSchema };
@@ -1,16 +0,0 @@
1
- import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
2
- import { JSONSchema, JSONSchemaReference } from "./definitions/jsonSchema.mjs";
3
- import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
4
-
5
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.ts
6
- type IndexReferencesById<SCHEMA_REFERENCES extends readonly JSONSchemaReference[]> = { [REF_SCHEMA in SCHEMA_REFERENCES[number] as REF_SCHEMA["$id"]]: REF_SCHEMA };
7
- type ParseOptions<ROOT_SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions> = {
8
- parseNotKeyword: OPTIONS["parseNotKeyword"] extends boolean ? OPTIONS["parseNotKeyword"] : FromSchemaDefaultOptions["parseNotKeyword"];
9
- parseIfThenElseKeywords: OPTIONS["parseIfThenElseKeywords"] extends boolean ? OPTIONS["parseIfThenElseKeywords"] : FromSchemaDefaultOptions["parseIfThenElseKeywords"];
10
- keepDefaultedPropertiesOptional: OPTIONS["keepDefaultedPropertiesOptional"] extends boolean ? OPTIONS["keepDefaultedPropertiesOptional"] : FromSchemaDefaultOptions["keepDefaultedPropertiesOptional"];
11
- rootSchema: ROOT_SCHEMA;
12
- references: OPTIONS["references"] extends JSONSchemaReference[] ? IndexReferencesById<OPTIONS["references"]> : {};
13
- deserialize: OPTIONS["deserialize"] extends DeserializationPattern[] | false ? OPTIONS["deserialize"] : FromSchemaDefaultOptions["deserialize"];
14
- };
15
- //#endregion
16
- export { ParseOptions };
@@ -1,13 +0,0 @@
1
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
2
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
3
- import { MergeSubSchema } from "./utils.mjs";
4
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
5
-
6
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.ts
7
- type AllOfSchema = JSONSchema & Readonly<{
8
- allOf: readonly JSONSchema[];
9
- }>;
10
- type ParseAllOfSchema<ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions> = RecurseOnAllOfSchema<ALL_OF_SCHEMA["allOf"], ALL_OF_SCHEMA, OPTIONS, ParseSchema<Omit<ALL_OF_SCHEMA, "allOf">, OPTIONS>>;
11
- type RecurseOnAllOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions, PARSED_ROOT_ALL_OF_SCHEMA> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAllOfSchema<SUB_SCHEMAS_TAIL, ROOT_ALL_OF_SCHEMA, OPTIONS, $Intersect<ParseSchema<MergeSubSchema<Omit<ROOT_ALL_OF_SCHEMA, "allOf">, SUB_SCHEMAS_HEAD>, OPTIONS>, PARSED_ROOT_ALL_OF_SCHEMA>> : never : never : PARSED_ROOT_ALL_OF_SCHEMA;
12
- //#endregion
13
- export { AllOfSchema, ParseAllOfSchema };
@@ -1,14 +0,0 @@
1
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { MergeSubSchema } from "./utils.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.ts
8
- type AnyOfSchema = JSONSchema & Readonly<{
9
- anyOf: readonly JSONSchema[];
10
- }>;
11
- type ParseAnyOfSchema<ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnAnyOfSchema<ANY_OF_SCHEMA["anyOf"], ANY_OF_SCHEMA, OPTIONS>>;
12
- type RecurseOnAnyOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAnyOfSchema<SUB_SCHEMAS_TAIL, ROOT_ANY_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
13
- //#endregion
14
- export { AnyOfSchema, ParseAnyOfSchema };
@@ -1,58 +0,0 @@
1
- import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
- import { $Tuple } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.mjs";
3
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
4
- import { _$Array } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.mjs";
5
- import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
6
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
7
- import { And } from "../type-utils/and.mjs";
8
- import { DoesExtend } from "../type-utils/extends.mjs";
9
- import { Not } from "../type-utils/not.mjs";
10
- import { Tail } from "../type-utils/tail.mjs";
11
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
12
-
13
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.ts
14
- type ArrayOrTupleSchema = JSONSchema & Readonly<{
15
- type: "array";
16
- }>;
17
- type ArraySchema = Omit<JSONSchema, "items"> & Readonly<{
18
- type: "array";
19
- items: JSONSchema;
20
- }>;
21
- type TupleSchema = JSONSchema & Readonly<{
22
- type: "array";
23
- items: readonly JSONSchema[];
24
- }>;
25
- type ParseArrayOrTupleSchema<ARRAY_OR_TUPLE_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ARRAY_OR_TUPLE_SCHEMA extends ArraySchema ? _$Array<ParseSchema<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>> : ARRAY_OR_TUPLE_SCHEMA extends TupleSchema ? $Union<ApplyMinMaxAndAdditionalItems<ParseTupleItems<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>, ARRAY_OR_TUPLE_SCHEMA, OPTIONS>> : _$Array;
26
- type ParseTupleItems<ITEM_SCHEMAS extends readonly JSONSchema[], OPTIONS extends ParseSchemaOptions> = ITEM_SCHEMAS extends readonly [infer ITEM_SCHEMAS_HEAD, ...infer ITEM_SCHEMAS_TAIL] ? ITEM_SCHEMAS_HEAD extends JSONSchema ? ITEM_SCHEMAS_TAIL extends readonly JSONSchema[] ? [ParseSchema<ITEM_SCHEMAS_HEAD, OPTIONS>, ...ParseTupleItems<ITEM_SCHEMAS_TAIL, OPTIONS>] : never : never : [];
27
- type ApplyMinMaxAndAdditionalItems<PARSED_ITEM_SCHEMAS extends any[], ROOT_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ApplyAdditionalItems<ApplyMinMax<PARSED_ITEM_SCHEMAS, ROOT_SCHEMA extends Readonly<{
28
- minItems: number;
29
- }> ? ROOT_SCHEMA["minItems"] : 0, ROOT_SCHEMA extends Readonly<{
30
- maxItems: number;
31
- }> ? ROOT_SCHEMA["maxItems"] : undefined>, ROOT_SCHEMA extends Readonly<{
32
- additionalItems: JSONSchema;
33
- }> ? ROOT_SCHEMA["additionalItems"] : true, OPTIONS>;
34
- type ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS extends any[], MIN extends number, MAX extends number | undefined, RESULT = never, HAS_ENCOUNTERED_MIN extends boolean = false, HAS_ENCOUNTERED_MAX extends boolean = false, INITIAL_PARSED_ITEM_SCHEMAS extends any[] = RECURSED_PARSED_ITEM_SCHEMAS> = And<Not<DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>>, DoesExtend<RECURSED_PARSED_ITEM_SCHEMAS, [any, ...any[]]>> extends true ? RECURSED_PARSED_ITEM_SCHEMAS extends [...infer RECURSED_PARSED_ITEM_SCHEMAS_BODY, unknown] ? ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS_BODY, MIN, MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"] extends MAX ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>, HAS_ENCOUNTERED_MIN extends true ? true : DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, HAS_ENCOUNTERED_MAX extends true ? true : DoesExtend<MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, INITIAL_PARSED_ITEM_SCHEMAS> : never : {
35
- result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
36
- hasEncounteredMin: DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>;
37
- hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
38
- completeTuple: INITIAL_PARSED_ITEM_SCHEMAS;
39
- };
40
- type IsLongerThan<TUPLE extends any[], LENGTH extends number | undefined, RESULT extends boolean = false> = LENGTH extends undefined ? false : TUPLE["length"] extends LENGTH ? true : TUPLE extends [any, ...infer TUPLE_TAIL] ? IsLongerThan<TUPLE_TAIL, LENGTH> : RESULT;
41
- type ApplyAdditionalItems<APPLY_MIN_MAX_RESULT extends {
42
- result: any;
43
- hasEncounteredMin: boolean;
44
- hasEncounteredMax: boolean;
45
- completeTuple: any[];
46
- }, ADDITIONAL_ITEMS_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions> = APPLY_MIN_MAX_RESULT extends {
47
- hasEncounteredMax: true;
48
- } ? APPLY_MIN_MAX_RESULT extends {
49
- hasEncounteredMin: true;
50
- } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends false ? APPLY_MIN_MAX_RESULT extends {
51
- hasEncounteredMin: true;
52
- } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends true ? APPLY_MIN_MAX_RESULT extends {
53
- hasEncounteredMin: true;
54
- } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : APPLY_MIN_MAX_RESULT extends {
55
- hasEncounteredMin: true;
56
- } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>>;
57
- //#endregion
58
- export { ArrayOrTupleSchema, ParseArrayOrTupleSchema };
@@ -1,14 +0,0 @@
1
- import { Const } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { Writable } from "../type-utils/writable.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.ts
8
- type ConstSchema = JSONSchema & Readonly<{
9
- const: unknown;
10
- }>;
11
- type ParseConstSchema<CONST_SCHEMA extends ConstSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseConst<CONST_SCHEMA>, ParseSchema<Omit<CONST_SCHEMA, "const">, OPTIONS>>;
12
- type ParseConst<CONST_SCHEMA extends ConstSchema> = Const<Writable<CONST_SCHEMA["const"]>>;
13
- //#endregion
14
- export { ConstSchema, ParseConstSchema };
@@ -1,13 +0,0 @@
1
- import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { DeserializationPattern } from "../definitions/deserializationPattern.mjs";
4
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
- import { ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.ts
8
- type DeserializeSchema<SCHEMA extends JSONSchema, OPTIONS extends Omit<ParseSchemaOptions, "deserialize"> & {
9
- deserialize: DeserializationPattern[];
10
- }> = RecurseOnDeserializationPatterns<SCHEMA, OPTIONS["deserialize"]>;
11
- type RecurseOnDeserializationPatterns<SCHEMA extends JSONSchema, DESERIALIZATION_PATTERNS extends DeserializationPattern[], RESULT = Any> = DESERIALIZATION_PATTERNS extends [infer DESERIALIZATION_PATTERNS_HEAD, ...infer DESERIALIZATION_PATTERNS_TAIL] ? DESERIALIZATION_PATTERNS_HEAD extends DeserializationPattern ? DESERIALIZATION_PATTERNS_TAIL extends DeserializationPattern[] ? RecurseOnDeserializationPatterns<SCHEMA, DESERIALIZATION_PATTERNS_TAIL, SCHEMA extends DESERIALIZATION_PATTERNS_HEAD["pattern"] ? $Intersect<Any<true, DESERIALIZATION_PATTERNS_HEAD["output"]>, RESULT> : RESULT> : never : never : RESULT;
12
- //#endregion
13
- export { DeserializeSchema };
@@ -1,14 +0,0 @@
1
- import { Enum } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { Writable } from "../type-utils/writable.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.ts
8
- type EnumSchema = JSONSchema & Readonly<{
9
- enum: readonly unknown[];
10
- }>;
11
- type ParseEnumSchema<ENUM_SCHEMA extends EnumSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseEnum<ENUM_SCHEMA>, ParseSchema<Omit<ENUM_SCHEMA, "enum">, OPTIONS>>;
12
- type ParseEnum<ENUM_SCHEMA extends EnumSchema> = Enum<Writable<ENUM_SCHEMA["enum"][number]>>;
13
- //#endregion
14
- export { EnumSchema, ParseEnumSchema };
@@ -1,20 +0,0 @@
1
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { _$Exclude } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.mjs";
4
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
- import { MergeSubSchema } from "./utils.mjs";
6
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
7
-
8
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.ts
9
- type IfThenElseSchema = JSONSchema & {
10
- if: JSONSchema;
11
- then?: JSONSchema;
12
- else?: JSONSchema;
13
- };
14
- type ParseIfThenElseSchema<IF_THEN_ELSE_SCHEMA extends IfThenElseSchema, OPTIONS extends ParseSchemaOptions, REST_SCHEMA extends JSONSchema = Omit<IF_THEN_ELSE_SCHEMA, "if" | "then" | "else">, IF_SCHEMA extends JSONSchema = MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["if"]>, PARSED_THEN_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
15
- then: JSONSchema;
16
- } ? $Intersect<ParseSchema<IF_SCHEMA, OPTIONS>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["then"]>, OPTIONS>> : ParseSchema<IF_SCHEMA, OPTIONS>), PARSED_ELSE_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
17
- else: JSONSchema;
18
- } ? $Intersect<_$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["else"]>, OPTIONS>> : _$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>)> = $Intersect<$Union<PARSED_THEN_SCHEMA | PARSED_ELSE_SCHEMA>, ParseSchema<REST_SCHEMA, OPTIONS>>;
19
- //#endregion
20
- export { IfThenElseSchema, ParseIfThenElseSchema };