@kubb/parser
Advanced tools
Comparing version
@@ -108,2 +108,6 @@ import ts from 'typescript'; | ||
}): ts.EnumDeclaration[] | (ts.TypeAliasDeclaration | ts.VariableStatement)[]; | ||
declare function createOmitDeclaration({ keys, type }: { | ||
keys: Array<string> | string; | ||
type: ts.TypeNode; | ||
}): ts.TypeReferenceNode; | ||
@@ -118,2 +122,2 @@ declare function print(elements: ts.Node | Array<ts.Node | undefined> | null, fileName?: string): string; | ||
export { ArrayTwoOrMore, appendJSDocToNode, createEnumDeclaration, createExportDeclaration, createImportDeclaration, createIndexSignature, createIntersectionDeclaration, createJSDoc, createParameterSignature, createPropertySignature, createQuestionToken, createTupleDeclaration, createTypeAliasDeclaration, createUnionDeclaration, modifiers, parse, print }; | ||
export { ArrayTwoOrMore, appendJSDocToNode, createEnumDeclaration, createExportDeclaration, createImportDeclaration, createIndexSignature, createIntersectionDeclaration, createJSDoc, createOmitDeclaration, createParameterSignature, createPropertySignature, createQuestionToken, createTupleDeclaration, createTypeAliasDeclaration, createUnionDeclaration, modifiers, parse, print }; |
@@ -275,2 +275,15 @@ import { createRequire } from 'module'; | ||
} | ||
function createOmitDeclaration({ keys, type }) { | ||
if (Array.isArray(keys)) { | ||
return factory.createTypeReferenceNode(factory.createIdentifier("Omit"), [ | ||
type, | ||
factory.createUnionTypeNode( | ||
keys.map((key) => { | ||
return factory.createLiteralTypeNode(factory.createStringLiteral(key)); | ||
}) | ||
) | ||
]); | ||
} | ||
return factory.createTypeReferenceNode(factory.createIdentifier("Omit"), [type, factory.createLiteralTypeNode(factory.createStringLiteral(keys))]); | ||
} | ||
var { factory: factory2 } = ts; | ||
@@ -302,4 +315,4 @@ function print(elements, fileName = "print.ts") { | ||
export { appendJSDocToNode, createEnumDeclaration, createExportDeclaration, createImportDeclaration, createIndexSignature, createIntersectionDeclaration, createJSDoc, createParameterSignature, createPropertySignature, createQuestionToken, createTupleDeclaration, createTypeAliasDeclaration, createUnionDeclaration, modifiers, parse, print }; | ||
export { appendJSDocToNode, createEnumDeclaration, createExportDeclaration, createImportDeclaration, createIndexSignature, createIntersectionDeclaration, createJSDoc, createOmitDeclaration, createParameterSignature, createPropertySignature, createQuestionToken, createTupleDeclaration, createTypeAliasDeclaration, createUnionDeclaration, modifiers, parse, print }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@kubb/parser", | ||
"version": "1.12.0-canary.20231016T100000", | ||
"version": "1.12.0-canary.20231016T112839", | ||
"description": "Generator parser", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
75784
4.53%760
4.25%