@sinclair/typebox-codegen
Advanced tools
Sorry, the diff of this file is not supported yet
+1
-1
| { | ||
| "name": "@sinclair/typebox-codegen", | ||
| "version": "0.9.0", | ||
| "version": "0.9.1", | ||
| "description": "Code Generation Tools for TypeBox", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
| import { TSchema } from '@sinclair/typebox'; | ||
| import { type TSchema } from '@sinclair/typebox'; | ||
| import { TypeBoxModel } from '../model/model'; | ||
@@ -3,0 +3,0 @@ export declare namespace TypeScriptToModel { |
@@ -40,4 +40,4 @@ "use strict"; | ||
| const exports = {}; | ||
| const evaluate = new Function('exports', 'Type', 'Kind', code); | ||
| evaluate(exports, typebox_1.Type, typebox_1.Kind); | ||
| const evaluate = new Function('exports', 'Type', 'Kind', 'CloneType', code); | ||
| evaluate(exports, typebox_1.Type, typebox_1.Kind, typebox_1.CloneType); | ||
| return new Map(globalThis.Object.entries(exports)); | ||
@@ -44,0 +44,0 @@ } |
@@ -67,3 +67,3 @@ "use strict"; | ||
| // (auto) tracked for cases where composition requires deep clone | ||
| let useTypeClone = false; | ||
| let useCloneType = false; | ||
| // (option) export override to ensure all schematics | ||
@@ -165,9 +165,9 @@ let useExportsEverything = false; | ||
| if (type.lastIndexOf(']') === type.length - 1) | ||
| useTypeClone = true; | ||
| useCloneType = true; | ||
| if (type.lastIndexOf(']') === type.length - 1) | ||
| return `TypeClone.Clone(${type}, ${encoded})`; | ||
| return `CloneType(${type}, ${encoded})`; | ||
| // referenced type | ||
| if (type.indexOf('(') === -1) { | ||
| useTypeClone = true; | ||
| return `TypeClone.Type(${type}, ${encoded})`; | ||
| useCloneType = true; | ||
| return `CloneType(${type}, ${encoded})`; | ||
| } | ||
@@ -660,4 +660,4 @@ if (type.lastIndexOf('()') === type.length - 2) | ||
| } | ||
| if (useTypeClone) { | ||
| set.add('TypeClone'); | ||
| if (useCloneType) { | ||
| set.add('CloneType'); | ||
| } | ||
@@ -676,3 +676,3 @@ const imports = [...set].join(', '); | ||
| useGenerics = false; | ||
| useTypeClone = false; | ||
| useCloneType = false; | ||
| blockLevel = 0; | ||
@@ -679,0 +679,0 @@ const source = ts.createSourceFile('types.ts', typescriptCode, ts.ScriptTarget.ESNext, true); |
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
290119
39.08%46
2.22%