@anttiviljami/dtsgenerator
Advanced tools
Comparing version 3.19.1 to 3.19.2
@@ -23,2 +23,3 @@ import * as ts from 'typescript'; | ||
export declare function buildFreeFormObjectTypeLiteralNode(): ts.TypeNode; | ||
export declare function buildEmptyObjectTypeLiteralNode(): ts.TypeNode; | ||
export declare function buildUnionTypeNode<T>(types: T[], builder: (t: T, index: number) => ts.TypeNode, terminate: boolean): ts.TypeNode; | ||
@@ -25,0 +26,0 @@ export declare function buildIntersectionTypeNode(types: readonly ts.TypeNode[], terminate: boolean): ts.TypeNode; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addOptionalInformation = exports.addComment = exports.buildTypeReferenceNode = exports.buildTupleTypeNode = exports.buildIntersectionTypeNode = exports.buildUnionTypeNode = exports.buildFreeFormObjectTypeLiteralNode = exports.buildTypeLiteralNode = exports.buildIndexSignatureNode = exports.buildPropertySignature = exports.buildTypeAliasNode = exports.buildInterfaceNode = exports.buildNamespaceNode = exports.buildBooleanLiteralTypeNode = exports.buildNumericLiteralTypeNode = exports.buildStringLiteralTypeNode = exports.buildNullKeyword = exports.buildSimpleArrayNode = exports.buildStringKeyword = exports.buildVoidKeyword = exports.buildUnknownKeyword = exports.buildNeverKeyword = exports.buildAnyKeyword = exports.buildKeyword = void 0; | ||
exports.addOptionalInformation = exports.addComment = exports.buildTypeReferenceNode = exports.buildTupleTypeNode = exports.buildIntersectionTypeNode = exports.buildUnionTypeNode = exports.buildEmptyObjectTypeLiteralNode = exports.buildFreeFormObjectTypeLiteralNode = exports.buildTypeLiteralNode = exports.buildIndexSignatureNode = exports.buildPropertySignature = exports.buildTypeAliasNode = exports.buildInterfaceNode = exports.buildNamespaceNode = exports.buildBooleanLiteralTypeNode = exports.buildNumericLiteralTypeNode = exports.buildStringLiteralTypeNode = exports.buildNullKeyword = exports.buildSimpleArrayNode = exports.buildStringKeyword = exports.buildVoidKeyword = exports.buildUnknownKeyword = exports.buildNeverKeyword = exports.buildAnyKeyword = exports.buildKeyword = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -117,2 +117,8 @@ const ts = tslib_1.__importStar(require("typescript")); | ||
exports.buildFreeFormObjectTypeLiteralNode = buildFreeFormObjectTypeLiteralNode; | ||
function buildEmptyObjectTypeLiteralNode() { | ||
return ts.factory.createTypeLiteralNode([ | ||
buildIndexSignatureNode('key', buildStringKeyword(), buildNeverKeyword()), | ||
]); | ||
} | ||
exports.buildEmptyObjectTypeLiteralNode = buildEmptyObjectTypeLiteralNode; | ||
function buildUnionTypeNode(types, builder, terminate) { | ||
@@ -119,0 +125,0 @@ const node = ts.factory.createUnionTypeNode(types.map(builder)); |
@@ -453,2 +453,5 @@ "use strict"; | ||
} | ||
else if (schema.content.additionalProperties === false) { | ||
return ast.buildEmptyObjectTypeLiteralNode(); | ||
} | ||
else { | ||
@@ -455,0 +458,0 @@ return ast.buildFreeFormObjectTypeLiteralNode(); |
{ | ||
"name": "@anttiviljami/dtsgenerator", | ||
"version": "3.19.1", | ||
"version": "3.19.2", | ||
"description": "TypeScript d.ts file generator for JSON Schema file", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -179,2 +179,12 @@ import * as ts from 'typescript'; | ||
export function buildEmptyObjectTypeLiteralNode(): ts.TypeNode { | ||
return ts.factory.createTypeLiteralNode([ | ||
buildIndexSignatureNode( | ||
'key', | ||
buildStringKeyword(), | ||
buildNeverKeyword(), | ||
), | ||
]); | ||
} | ||
export function buildUnionTypeNode<T>( | ||
@@ -181,0 +191,0 @@ types: T[], |
@@ -704,2 +704,4 @@ import Debug from 'debug'; | ||
return ast.buildTypeLiteralNode(elements); | ||
} else if (schema.content.additionalProperties === false) { | ||
return ast.buildEmptyObjectTypeLiteralNode(); | ||
} else { | ||
@@ -706,0 +708,0 @@ return ast.buildFreeFormObjectTypeLiteralNode(); |
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
381697
8473