Socket
Socket
Sign inDemoInstall

@deepkit/core

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepkit/core - npm Package Compare versions

Comparing version 1.0.1-alpha.97 to 1.0.1-alpha.100

3

dist/cjs/src/compiler.d.ts

@@ -20,2 +20,5 @@ export declare class CompilerContext {

reserveName(name: string): string;
set(values: {
[name: string]: any;
}): void;
/**

@@ -22,0 +25,0 @@ * Returns always the same variable name for the same value.

@@ -16,2 +16,3 @@ "use strict";

const indent_js_1 = require("./indent.js");
const core_js_1 = require("./core.js");
class CompilerContext {

@@ -44,2 +45,10 @@ constructor(config = {}) {

}
set(values) {
for (const i in values) {
if (!(0, core_js_1.hasProperty)(values, i)) {
continue;
}
this.context.set(i, values[i]);
}
}
/**

@@ -114,3 +123,3 @@ * Returns always the same variable name for the same value.

exports.CompilerContext = CompilerContext;
CompilerContext.__type = ['maxReservedVariable', function () { return 10000; }, 'variableContext', function () { return {}; }, 'preCode', function () { return ''; }, 'initialiseVariables', function () { return []; }, 'indent', 'config', function () { return { indent: false }; }, () => __ΩPartial, () => CompilerContext, "config", () => ({}), 'constructor', 'name', 'reserveName', 'value', () => "constVar", 'reserveConst', () => "var", 'reserveVariable', 'functionCode', '', 'raw', 'code', 'format', 'args', 'build', '', 'buildAsync', '\'3!>"P&"LM3#<>$&3%>&&F3\'>(P)4)M3*>+PP7-..fo,"2*>/"00P&21&02P"23&21>4&05P&21>6"238&07P&28P"/90:P&2;&0<<P&28&@2="0>P&28&@2=P"/?0@5'];
CompilerContext.__type = ['maxReservedVariable', function () { return 10000; }, 'variableContext', function () { return {}; }, 'preCode', function () { return ''; }, 'initialiseVariables', function () { return []; }, 'indent', 'config', function () { return { indent: false }; }, () => __ΩPartial, () => CompilerContext, "config", () => ({}), 'constructor', 'name', 'reserveName', 'values', 'set', 'value', () => "constVar", 'reserveConst', () => "var", 'reserveVariable', 'functionCode', '', 'raw', 'code', 'format', 'args', 'build', '', 'buildAsync', '\'3!>"P&"LM3#<>$&3%>&&F3\'>(P)4)M3*>+PP7-..fo,"2*>/"00P&21&02PP&"LM23"04P"25&21>6&07P&21>8"258&09P&2:P"/;0<P&2=&0><P&2:&@2?"0@P&2:&@2?P"/A0B5'];
//# sourceMappingURL=compiler.js.map

@@ -363,4 +363,40 @@ /**

}[];
/**
* Forwards the runtime type arguments from function x to function y.
* This is necessary when a generic function is overridden and forwarded to something else.
*
* ```typescript
* let generic = <T>(type?: ReceiveType<T>) => undefined;
*
* let forwarded<T> = () => {
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
* generic(); //call as usual
* }
*
* forwarded<any>(); //generic receives any in runtime.
* ```
*
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
* reach the original function anymore.
*
* ```typescript
* let forwarded<T> = () => {
* const bound = generic.bind(this);
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
* bound(); //fails
* }
* ```
*
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
*
* ```typescript
* let forwarded<T> = (type?: ReceiveType<T>) => {
* const bound = generic.bind(this);
* bound(type);
* }
* ```
*/
export declare function forwardTypeArguments(x: any, y: any): void;
export declare type __ΩClassType = any[];
export declare type __ΩAbstractClassType = any[];
export declare type __ΩExtractClassType = any[];

@@ -7,3 +7,3 @@ "use strict";

exports.getObjectKeysSize = exports.humanBytes = exports.deletePathValue = exports.setPathValue = exports.getPathValue = exports.time = exports.collectForMicrotask = exports.mergeStack = exports.createStack = exports.mergePromiseStack = exports.asyncOperation = exports.appendObject = exports.prependObjectKeys = exports.average = exports.last = exports.first = exports.lastKey = exports.firstKey = exports.size = exports.empty = exports.copy = exports.sleep = exports.indexOf = exports.isString = exports.isInteger = exports.isNumeric = exports.isNumber = exports.isSet = exports.isUndefined = exports.isNull = exports.isArray = exports.isObject = exports.isClass = exports.isPromise = exports.isAsyncFunction = exports.isFunction = exports.prettyPrintObject = exports.changeClass = exports.stringifyValueWithType = exports.isClassInstance = exports.getClassTypeFromInstance = exports.isPlainObject = exports.identifyType = exports.applyDefaults = exports.getClassPropertyName = exports.getClassName = exports.__ΩExtractClassType = exports.__ΩAbstractClassType = exports.__ΩClassType = exports.CustomError = void 0;
exports.zip = exports.rangeArray = exports.range = exports.hasProperty = exports.escapeRegExp = exports.getCurrentFileName = exports.isIterable = exports.createDynamicClass = exports.inDebugMode = exports.getParentClass = exports.isPrototypeOfBase = exports.isConstructable = void 0;
exports.forwardTypeArguments = exports.zip = exports.rangeArray = exports.range = exports.hasProperty = exports.escapeRegExp = exports.getCurrentFileName = exports.isIterable = exports.createDynamicClass = exports.inDebugMode = exports.getParentClass = exports.isPrototypeOfBase = exports.isConstructable = void 0;
function __assignType(fn, args) {

@@ -834,2 +834,42 @@ fn.__type = args;

zip.__type = ['args', 'zip', 'l:e"!R!RPd"e#!fh!!Fqk#\'QRP"@2!Pd"gN)!F/"'];
/**
* Forwards the runtime type arguments from function x to function y.
* This is necessary when a generic function is overridden and forwarded to something else.
*
* ```typescript
* let generic = <T>(type?: ReceiveType<T>) => undefined;
*
* let forwarded<T> = () => {
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
* generic(); //call as usual
* }
*
* forwarded<any>(); //generic receives any in runtime.
* ```
*
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
* reach the original function anymore.
*
* ```typescript
* let forwarded<T> = () => {
* const bound = generic.bind(this);
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
* bound(); //fails
* }
* ```
*
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
*
* ```typescript
* let forwarded<T> = (type?: ReceiveType<T>) => {
* const bound = generic.bind(this);
* bound(type);
* }
* ```
*/
function forwardTypeArguments(x, y) {
y.Ω = x.Ω;
}
exports.forwardTypeArguments = forwardTypeArguments;
forwardTypeArguments.__type = ['x', 'y', 'forwardTypeArguments', 'P"2!"2"$/#'];
//# sourceMappingURL=core.js.map

@@ -20,2 +20,5 @@ export declare class CompilerContext {

reserveName(name: string): string;
set(values: {
[name: string]: any;
}): void;
/**

@@ -22,0 +25,0 @@ * Returns always the same variable name for the same value.

@@ -13,2 +13,3 @@ const __ΩPartial = ['T', 'l+e#!e"!fRb!Pde"!gN#"'];

import { indent } from './indent.js';
import { hasProperty } from './core.js';
export class CompilerContext {

@@ -41,2 +42,10 @@ constructor(config = {}) {

}
set(values) {
for (const i in values) {
if (!hasProperty(values, i)) {
continue;
}
this.context.set(i, values[i]);
}
}
/**

@@ -110,3 +119,3 @@ * Returns always the same variable name for the same value.

}
CompilerContext.__type = ['maxReservedVariable', function () { return 10000; }, 'variableContext', function () { return {}; }, 'preCode', function () { return ''; }, 'initialiseVariables', function () { return []; }, 'indent', 'config', function () { return { indent: false }; }, () => __ΩPartial, () => CompilerContext, "config", () => ({}), 'constructor', 'name', 'reserveName', 'value', () => "constVar", 'reserveConst', () => "var", 'reserveVariable', 'functionCode', '', 'raw', 'code', 'format', 'args', 'build', '', 'buildAsync', '\'3!>"P&"LM3#<>$&3%>&&F3\'>(P)4)M3*>+PP7-..fo,"2*>/"00P&21&02P"23&21>4&05P&21>6"238&07P&28P"/90:P&2;&0<<P&28&@2="0>P&28&@2=P"/?0@5'];
CompilerContext.__type = ['maxReservedVariable', function () { return 10000; }, 'variableContext', function () { return {}; }, 'preCode', function () { return ''; }, 'initialiseVariables', function () { return []; }, 'indent', 'config', function () { return { indent: false }; }, () => __ΩPartial, () => CompilerContext, "config", () => ({}), 'constructor', 'name', 'reserveName', 'values', 'set', 'value', () => "constVar", 'reserveConst', () => "var", 'reserveVariable', 'functionCode', '', 'raw', 'code', 'format', 'args', 'build', '', 'buildAsync', '\'3!>"P&"LM3#<>$&3%>&&F3\'>(P)4)M3*>+PP7-..fo,"2*>/"00P&21&02PP&"LM23"04P"25&21>6&07P&21>8"258&09P&2:P"/;0<P&2=&0><P&2:&@2?"0@P&2:&@2?P"/A0B5'];
//# sourceMappingURL=compiler.js.map

@@ -363,4 +363,40 @@ /**

}[];
/**
* Forwards the runtime type arguments from function x to function y.
* This is necessary when a generic function is overridden and forwarded to something else.
*
* ```typescript
* let generic = <T>(type?: ReceiveType<T>) => undefined;
*
* let forwarded<T> = () => {
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
* generic(); //call as usual
* }
*
* forwarded<any>(); //generic receives any in runtime.
* ```
*
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
* reach the original function anymore.
*
* ```typescript
* let forwarded<T> = () => {
* const bound = generic.bind(this);
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
* bound(); //fails
* }
* ```
*
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
*
* ```typescript
* let forwarded<T> = (type?: ReceiveType<T>) => {
* const bound = generic.bind(this);
* bound(type);
* }
* ```
*/
export declare function forwardTypeArguments(x: any, y: any): void;
export declare type __ΩClassType = any[];
export declare type __ΩAbstractClassType = any[];
export declare type __ΩExtractClassType = any[];

@@ -768,2 +768,41 @@ function __assignType(fn, args) {

zip.__type = ['args', 'zip', 'l:e"!R!RPd"e#!fh!!Fqk#\'QRP"@2!Pd"gN)!F/"'];
/**
* Forwards the runtime type arguments from function x to function y.
* This is necessary when a generic function is overridden and forwarded to something else.
*
* ```typescript
* let generic = <T>(type?: ReceiveType<T>) => undefined;
*
* let forwarded<T> = () => {
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
* generic(); //call as usual
* }
*
* forwarded<any>(); //generic receives any in runtime.
* ```
*
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
* reach the original function anymore.
*
* ```typescript
* let forwarded<T> = () => {
* const bound = generic.bind(this);
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
* bound(); //fails
* }
* ```
*
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
*
* ```typescript
* let forwarded<T> = (type?: ReceiveType<T>) => {
* const bound = generic.bind(this);
* bound(type);
* }
* ```
*/
export function forwardTypeArguments(x, y) {
y.Ω = x.Ω;
}
forwardTypeArguments.__type = ['x', 'y', 'forwardTypeArguments', 'P"2!"2"$/#'];
//# sourceMappingURL=core.js.map

4

package.json
{
"name": "@deepkit/core",
"version": "1.0.1-alpha.97",
"version": "1.0.1-alpha.100",
"description": "Deepkit core library",

@@ -44,3 +44,3 @@ "type": "commonjs",

},
"gitHead": "2112f2773b6781c98e2271d55a996ffb9da5f89c"
"gitHead": "3d8e2cad5f583d05d80d87858be92b8e64450ea9"
}

@@ -12,2 +12,3 @@ /*

import { indent } from './indent.js';
import { hasProperty } from './core.js';

@@ -49,2 +50,11 @@ export class CompilerContext {

set(values: { [name: string]: any }) {
for (const i in values) {
if (!hasProperty(values, i)) {
continue;
}
this.context.set(i, values[i]);
}
}
/**

@@ -51,0 +61,0 @@ * Returns always the same variable name for the same value.

@@ -763,1 +763,40 @@ /*

}
/**
* Forwards the runtime type arguments from function x to function y.
* This is necessary when a generic function is overridden and forwarded to something else.
*
* ```typescript
* let generic = <T>(type?: ReceiveType<T>) => undefined;
*
* let forwarded<T> = () => {
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
* generic(); //call as usual
* }
*
* forwarded<any>(); //generic receives any in runtime.
* ```
*
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
* reach the original function anymore.
*
* ```typescript
* let forwarded<T> = () => {
* const bound = generic.bind(this);
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
* bound(); //fails
* }
* ```
*
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
*
* ```typescript
* let forwarded<T> = (type?: ReceiveType<T>) => {
* const bound = generic.bind(this);
* bound(type);
* }
* ```
*/
export function forwardTypeArguments(x: any, y: any): void {
y.Ω = x.Ω;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc