New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@sinclair/typebox-codegen

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinclair/typebox-codegen - npm Package Compare versions

Comparing version
0.9.0
to
0.9.1
sinclair-typebox-codegen-0.9.0.tgz

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);