@kubb/parser
Advanced tools
Comparing version 1.12.0-canary.20231016T112839 to 1.12.0-canary.20231016T142614
@@ -108,5 +108,6 @@ import ts from 'typescript'; | ||
}): ts.EnumDeclaration[] | (ts.TypeAliasDeclaration | ts.VariableStatement)[]; | ||
declare function createOmitDeclaration({ keys, type }: { | ||
declare function createOmitDeclaration({ keys, type, nonNullable }: { | ||
keys: Array<string> | string; | ||
type: ts.TypeNode; | ||
nonNullable?: boolean; | ||
}): ts.TypeReferenceNode; | ||
@@ -113,0 +114,0 @@ |
@@ -275,6 +275,7 @@ import { createRequire } from 'module'; | ||
} | ||
function createOmitDeclaration({ keys, type }) { | ||
function createOmitDeclaration({ keys, type, nonNullable }) { | ||
const node = nonNullable ? factory.createTypeReferenceNode(factory.createIdentifier("NonNullable"), [type]) : type; | ||
if (Array.isArray(keys)) { | ||
return factory.createTypeReferenceNode(factory.createIdentifier("Omit"), [ | ||
type, | ||
node, | ||
factory.createUnionTypeNode( | ||
@@ -287,3 +288,3 @@ keys.map((key) => { | ||
} | ||
return factory.createTypeReferenceNode(factory.createIdentifier("Omit"), [type, factory.createLiteralTypeNode(factory.createStringLiteral(keys))]); | ||
return factory.createTypeReferenceNode(factory.createIdentifier("Omit"), [node, factory.createLiteralTypeNode(factory.createStringLiteral(keys))]); | ||
} | ||
@@ -290,0 +291,0 @@ var { factory: factory2 } = ts; |
{ | ||
"name": "@kubb/parser", | ||
"version": "1.12.0-canary.20231016T112839", | ||
"version": "1.12.0-canary.20231016T142614", | ||
"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
76598
763