@sinclair/typebox-codegen
Advanced tools
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
+1
-1
| { | ||
| "name": "@sinclair/typebox-codegen", | ||
| "version": "0.9.1", | ||
| "version": "0.9.2", | ||
| "description": "Code Generation Tools for TypeBox", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -346,3 +346,3 @@ "use strict"; | ||
| const rawTypeExpression = IsRecursiveType(node) ? `Type.Recursive(This => Type.Object(${members}))` : `Type.Object(${members})`; | ||
| const typeExpression = heritage.length === 0 ? rawTypeExpression : `Type.Intersect([${heritage.join(', ')}, ${rawTypeExpression}])`; | ||
| const typeExpression = heritage.length === 0 ? rawTypeExpression : `Type.Composite([${heritage.join(', ')}, ${rawTypeExpression}])`; | ||
| const type = InjectOptions(typeExpression, options); | ||
@@ -359,3 +359,3 @@ const typeDeclaration = `${exports}const ${node.name.getText()} = <${constraints}>(${parameters}) => ${type}`; | ||
| const rawTypeExpression = IsRecursiveType(node) ? `Type.Recursive(This => Type.Object(${members}))` : `Type.Object(${members})`; | ||
| const typeExpression = heritage.length === 0 ? rawTypeExpression : `Type.Intersect([${heritage.join(', ')}, ${rawTypeExpression}])`; | ||
| const typeExpression = heritage.length === 0 ? rawTypeExpression : `Type.Composite([${heritage.join(', ')}, ${rawTypeExpression}])`; | ||
| const type = InjectOptions(typeExpression, options); | ||
@@ -400,6 +400,7 @@ const typeDeclaration = `${exports}const ${node.name.getText()} = ${type}`; | ||
| function* HeritageClause(node) { | ||
| // Consideration: This may be better expressed as a heritage type (for review) | ||
| const types = node.types.map((node) => Collect(node)); | ||
| if (types.length === 1) | ||
| return yield types[0]; | ||
| yield `Type.Intersect([${types.join(', ')}])`; | ||
| yield `Type.Composite([${types.join(', ')}])`; | ||
| } | ||
@@ -406,0 +407,0 @@ function* IndexedAccessType(node) { |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
779337
168.63%48
4.35%3240
0.03%