@nestjs/swagger
Advanced tools
Comparing version 7.0.8 to 7.0.9
@@ -23,3 +23,3 @@ import * as ts from 'typescript'; | ||
export declare function createBooleanLiteral(factory: ts.NodeFactory, flag: boolean): ts.BooleanLiteral; | ||
export declare function createPrimitiveLiteral(factory: ts.NodeFactory, item: unknown, typeOfItem?: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"): ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral | ts.PrefixUnaryExpression; | ||
export declare function createPrimitiveLiteral(factory: ts.NodeFactory, item: unknown, typeOfItem?: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"): ts.StringLiteral | ts.NumericLiteral | ts.PrefixUnaryExpression | ts.BooleanLiteral; | ||
export declare function createLiteralFromAnyValue(factory: ts.NodeFactory, item: unknown): any; |
@@ -254,7 +254,23 @@ "use strict"; | ||
} | ||
if (ts.isIdentifier(node) || ts.isCallExpression(node)) { | ||
if (ts.isCallExpression(node) || ts.isIdentifier(node)) { | ||
return false; | ||
} | ||
return true; | ||
if (ts.isNewExpression(node)) { | ||
if (node.expression?.escapedText === 'Date') { | ||
return true; | ||
} | ||
return false; | ||
} | ||
if (node.kind === ts.SyntaxKind.FalseKeyword || | ||
node.kind === ts.SyntaxKind.TrueKeyword || | ||
node.kind === ts.SyntaxKind.NullKeyword) { | ||
return true; | ||
} | ||
if (ts.isNumericLiteral(node) || | ||
ts.isPrefixUnaryExpression(node) || | ||
ts.isStringLiteral(node)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.canReferenceNode = canReferenceNode; |
@@ -235,2 +235,5 @@ "use strict"; | ||
if (!(0, plugin_utils_1.canReferenceNode)(initializer, options)) { | ||
const parentFilePath = node.getSourceFile().fileName; | ||
const propertyName = node.name.getText(); | ||
plugin_debug_logger_1.pluginDebugLogger.debug(`Skipping registering default value for "${propertyName}" property in "${parentFilePath}" file because it is not a referenceable value ("${initializer.getText()}").`); | ||
return undefined; | ||
@@ -237,0 +240,0 @@ } |
{ | ||
"name": "@nestjs/swagger", | ||
"version": "7.0.8", | ||
"version": "7.0.9", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@swagger)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
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
306931
6622