@kubb/ast 5.0.0-beta.33 → 5.0.0-beta.34
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/README.md +15 -5
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,28 @@ import { $ as update, $t as ScalarSchemaType, A as createBreak, At as FunctionPa
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
declare function narrowSchema<T extends SchemaNode['type']>(node: SchemaNode | undefined, type: T): SchemaNodeByType[T] | null;
|
|
15
|
+
/**
|
|
16
|
+
* Returns `true` when the input is an `InputNode`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* if (isInputNode(node)) {
|
|
21
|
+
* console.log(node.schemas.length)
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const isInputNode: (node: unknown) => node is InputNode;
|
|
26
|
+
/**
|
|
27
|
+
* Returns `true` when the input is an `OutputNode`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* if (isOutputNode(node)) {
|
|
32
|
+
* console.log(node.files.length)
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const isOutputNode: (node: unknown) => node is OutputNode;
|
|
15
37
|
/**
|
|
16
38
|
* Returns `true` when the input is an `OperationNode`.
|
|
17
39
|
*
|
|
@@ -148,5 +170,5 @@ declare function mergeAdjacentObjectsLazy(members: Iterable<SchemaNode>): Genera
|
|
|
148
170
|
declare function simplifyUnion(members: Array<SchemaNode>): Array<SchemaNode>;
|
|
149
171
|
declare function setEnumName(propNode: SchemaNode, parentName: string | null | undefined, propName: string, enumSuffix: string): SchemaNode;
|
|
150
172
|
//#endregion
|
|
151
|
-
export { type ArraySchemaNode, type ArrowFunctionNode, type AsyncVisitor, type BaseNode, type BreakNode, type BuildDedupePlanOptions, type CodeNode, type CollectOptions, type CollectVisitor, type ComplexSchemaType, type ConstNode, type DateSchemaNode, type DatetimeSchemaNode, type DedupeCanonical, type DedupePlan, type DispatchRule, type DistributiveOmit, type EnumSchemaNode, type EnumValueNode, type ExportNode, type FileNode, type FormatStringSchemaNode, type FunctionNode, type FunctionNodeType, type FunctionParamNode, type FunctionParameterNode, type FunctionParametersNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type HttpStatusCode, type ImportNode, type InferSchemaNode, type InputMeta, type InputNode, type InputStreamNode, type IntersectionSchemaNode, type Ipv4SchemaNode, type Ipv6SchemaNode, type JSDocNode, type JsxNode, type MediaType, type Node, type NodeKind, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type OperationNodeBase, type OperationParamsResolver, type OperationProtocol, type OutputNode, type ParameterGroupNode, type ParameterLocation, type ParameterNode, type ParamsTypeNode, type ParentOf, type ParserOptions, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type ResponseNode, type ScalarPrimitive, type ScalarSchemaNode, type ScalarSchemaType, type SchemaDialect, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type SpecialSchemaType, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TransformOptions, type TypeDeclarationNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, type VisitorDepth, type WalkOptions, applyDedupe, buildDedupePlan, caseParams, childName, collect, collectImports, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isOperationNode, isSchemaNode, isStringType, mergeAdjacentObjectsLazy, narrowSchema, schemaSignature, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
173
|
+
export { type ArraySchemaNode, type ArrowFunctionNode, type AsyncVisitor, type BaseNode, type BreakNode, type BuildDedupePlanOptions, type CodeNode, type CollectOptions, type CollectVisitor, type ComplexSchemaType, type ConstNode, type DateSchemaNode, type DatetimeSchemaNode, type DedupeCanonical, type DedupePlan, type DispatchRule, type DistributiveOmit, type EnumSchemaNode, type EnumValueNode, type ExportNode, type FileNode, type FormatStringSchemaNode, type FunctionNode, type FunctionNodeType, type FunctionParamNode, type FunctionParameterNode, type FunctionParametersNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type HttpStatusCode, type ImportNode, type InferSchemaNode, type InputMeta, type InputNode, type InputStreamNode, type IntersectionSchemaNode, type Ipv4SchemaNode, type Ipv6SchemaNode, type JSDocNode, type JsxNode, type MediaType, type Node, type NodeKind, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type OperationNodeBase, type OperationParamsResolver, type OperationProtocol, type OutputNode, type ParameterGroupNode, type ParameterLocation, type ParameterNode, type ParamsTypeNode, type ParentOf, type ParserOptions, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type ResponseNode, type ScalarPrimitive, type ScalarSchemaNode, type ScalarSchemaType, type SchemaDialect, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type SpecialSchemaType, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TransformOptions, type TypeDeclarationNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, type VisitorDepth, type WalkOptions, applyDedupe, buildDedupePlan, caseParams, childName, collect, collectImports, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isInputNode, isOperationNode, isOutputNode, isSchemaNode, isStringType, mergeAdjacentObjectsLazy, narrowSchema, schemaSignature, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
152
174
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -396,6 +396,28 @@ function isKind(kind) {
|
|
|
396
396
|
return (node) => node.kind === kind;
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
399
|
+
* Returns `true` when the input is an `InputNode`.
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```ts
|
|
403
|
+
* if (isInputNode(node)) {
|
|
404
|
+
* console.log(node.schemas.length)
|
|
405
|
+
* }
|
|
406
|
+
* ```
|
|
407
|
+
*/
|
|
408
|
+
const isInputNode = isKind("Input");
|
|
409
|
+
/**
|
|
410
|
+
* Returns `true` when the input is an `OutputNode`.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```ts
|
|
414
|
+
* if (isOutputNode(node)) {
|
|
415
|
+
* console.log(node.files.length)
|
|
416
|
+
* }
|
|
417
|
+
* ```
|
|
418
|
+
*/
|
|
419
|
+
const isOutputNode = isKind("Output");
|
|
420
|
+
/**
|
|
399
421
|
* Returns `true` when the input is an `OperationNode`.
|
|
400
422
|
*
|
|
401
423
|
* @example
|
|
@@ -2644,6 +2666,6 @@ function setEnumName(propNode, parentName, propName, enumSuffix) {
|
|
|
2644
2666
|
return propNode;
|
|
2645
2667
|
}
|
|
2646
2668
|
//#endregion
|
|
2647
|
-
export { applyDedupe, buildDedupePlan, caseParams, childName, collect, collectImports, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isOperationNode, isSchemaNode, isStringType, mergeAdjacentObjectsLazy, narrowSchema, schemaSignature, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
2669
|
+
export { applyDedupe, buildDedupePlan, caseParams, childName, collect, collectImports, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isInputNode, isOperationNode, isOutputNode, isSchemaNode, isStringType, mergeAdjacentObjectsLazy, narrowSchema, schemaSignature, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
2648
2670
|
|
|
2649
2671
|
//# sourceMappingURL=index.js.map
|