@kubb/ast 5.0.0-beta.24 → 5.0.0-beta.26
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.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/infer.ts +1 -1
- package/src/nodes/code.ts +2 -2
- package/src/nodes/root.ts +2 -2
- package/src/utils.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/ast",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.26",
|
|
4
4
|
"description": "Spec-agnostic AST layer for Kubb. Defines the node tree, visitor pattern, factory functions, and type guards used across all code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
package/src/infer.ts
CHANGED
|
@@ -77,7 +77,7 @@ type ResolveDateTimeNode<TDateType extends ParserOptions['dateType']> = DateTime
|
|
|
77
77
|
type SchemaNodeMap<TDateType extends ParserOptions['dateType'] = 'string'> = [
|
|
78
78
|
[{ $ref: string }, RefSchemaNode],
|
|
79
79
|
[{ allOf: ReadonlyArray<unknown>; properties: object }, IntersectionSchemaNode],
|
|
80
|
-
[{ allOf: readonly [unknown, unknown, ...unknown
|
|
80
|
+
[{ allOf: readonly [unknown, unknown, ...Array<unknown>] }, IntersectionSchemaNode],
|
|
81
81
|
[{ allOf: ReadonlyArray<unknown> }, SchemaNode],
|
|
82
82
|
[{ oneOf: ReadonlyArray<unknown> }, UnionSchemaNode],
|
|
83
83
|
[{ anyOf: ReadonlyArray<unknown> }, UnionSchemaNode],
|
package/src/nodes/code.ts
CHANGED
|
@@ -145,7 +145,7 @@ export type FunctionNode = BaseNode & {
|
|
|
145
145
|
* TypeScript generic type parameters.
|
|
146
146
|
* @example ['T', 'U extends string']
|
|
147
147
|
*/
|
|
148
|
-
generics?: string | string
|
|
148
|
+
generics?: string | Array<string> | null
|
|
149
149
|
/**
|
|
150
150
|
* Return type annotation.
|
|
151
151
|
* @example 'Pet'
|
|
@@ -206,7 +206,7 @@ export type ArrowFunctionNode = BaseNode & {
|
|
|
206
206
|
* TypeScript generic type parameters.
|
|
207
207
|
* @example ['T', 'U extends string']
|
|
208
208
|
*/
|
|
209
|
-
generics?: string | string
|
|
209
|
+
generics?: string | Array<string> | null
|
|
210
210
|
/**
|
|
211
211
|
* Return type annotation.
|
|
212
212
|
* @example 'Pet'
|
package/src/nodes/root.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type InputMeta = {
|
|
|
45
45
|
* if (circular.has(schema.name)) { ... }
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
circularNames:
|
|
48
|
+
circularNames: ReadonlyArray<string>
|
|
49
49
|
/**
|
|
50
50
|
* Names of schemas whose type is `enum`.
|
|
51
51
|
* Computed once during the adapter pre-scan — use this instead of filtering
|
|
@@ -58,7 +58,7 @@ export type InputMeta = {
|
|
|
58
58
|
* `const enums = new Set(meta.enumNames)`
|
|
59
59
|
* `const isEnum = enums.has(schemaName)`
|
|
60
60
|
*/
|
|
61
|
-
enumNames:
|
|
61
|
+
enumNames: ReadonlyArray<string>
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
package/src/utils.ts
CHANGED
|
@@ -726,7 +726,7 @@ export function extractStringsFromNodes(nodes: Array<CodeNode> | undefined): str
|
|
|
726
726
|
if (node.kind === 'Break') return ''
|
|
727
727
|
if (node.kind === 'Jsx') return node.value
|
|
728
728
|
|
|
729
|
-
const parts: string
|
|
729
|
+
const parts: Array<string> = []
|
|
730
730
|
|
|
731
731
|
if ('params' in node && node.params) parts.push(node.params)
|
|
732
732
|
if ('generics' in node && node.generics) parts.push(Array.isArray(node.generics) ? node.generics.join(', ') : node.generics)
|
|
@@ -878,7 +878,7 @@ const findCircularSchemasMemo = memoize(new WeakMap<ReadonlyArray<SchemaNode>, S
|
|
|
878
878
|
const circular = new Set<string>()
|
|
879
879
|
for (const start of graph.keys()) {
|
|
880
880
|
const visited = new Set<string>()
|
|
881
|
-
const stack: string
|
|
881
|
+
const stack: Array<string> = [...(graph.get(start) ?? [])]
|
|
882
882
|
while (stack.length > 0) {
|
|
883
883
|
const node = stack.pop()!
|
|
884
884
|
if (node === start) {
|