@sinclair/typebox-codegen
Advanced tools
Sorry, the diff of this file is not supported yet
@@ -167,3 +167,6 @@ "use strict"; | ||
| function Union(schema) { | ||
| return Type(schema, `y.mixed().oneOf([${schema.anyOf.map((schema) => Visit(schema)).join(`, `)}]).required()`); | ||
| const isLiteralUnion = schema.anyOf.every((schema) => Types.TypeGuard.IsLiteral(schema)); | ||
| return isLiteralUnion | ||
| ? Type(schema, `y.mixed().oneOf([${schema.anyOf.map((schema) => JSON.stringify(schema.const)).join(`, `)}]).required()`) | ||
| : Type(schema, `y.mixed().oneOf([${schema.anyOf.map((schema) => Visit(schema)).join(`, `)}]).required()`); | ||
| } | ||
@@ -170,0 +173,0 @@ function Unknown(schema) { |
+1
-1
| { | ||
| "name": "@sinclair/typebox-codegen", | ||
| "version": "0.9.7", | ||
| "version": "0.9.8", | ||
| "description": "Code Generation Tools for TypeBox", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
209049
24.3%45
2.27%3247
0.09%