@kubb/parser
Advanced tools
Comparing version 1.11.4 to 1.11.5
@@ -37,3 +37,4 @@ import ts from 'typescript'; | ||
}): ts.TypeNode | null; | ||
declare function createPropertySignature({ modifiers, name, questionToken, type, }: { | ||
declare function createPropertySignature({ readOnly, modifiers, name, questionToken, type, }: { | ||
readOnly?: boolean; | ||
modifiers?: Array<ts.Modifier>; | ||
@@ -108,2 +109,6 @@ name: ts.PropertyName | string; | ||
}): ts.EnumDeclaration[] | (ts.TypeAliasDeclaration | ts.VariableStatement)[]; | ||
declare function createOmitDeclaration({ keys, type }: { | ||
keys: Array<string> | string; | ||
type: ts.TypeNode; | ||
}): ts.TypeReferenceNode; | ||
@@ -118,2 +123,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 }; |
@@ -78,3 +78,4 @@ import { createRequire } from 'module'; | ||
function createPropertySignature({ | ||
modifiers: modifiers2, | ||
readOnly, | ||
modifiers: modifiers2 = [], | ||
name, | ||
@@ -84,3 +85,8 @@ questionToken: questionToken2, | ||
}) { | ||
return factory.createPropertySignature(modifiers2, propertyName(name), createQuestionToken(questionToken2), type); | ||
return factory.createPropertySignature( | ||
[...modifiers2, readOnly ? factory.createToken(ts.SyntaxKind.ReadonlyKeyword) : void 0].filter(Boolean), | ||
propertyName(name), | ||
createQuestionToken(questionToken2), | ||
type | ||
); | ||
} | ||
@@ -271,2 +277,15 @@ function createParameterSignature(name, { | ||
} | ||
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; | ||
@@ -298,4 +317,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.11.4", | ||
"version": "1.11.5", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75761
760