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.105 to 1.0.1-alpha.108

11

CHANGELOG.md

@@ -6,4 +6,15 @@ # Change Log

## [1.0.1-alpha.108](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.107...v1.0.1-alpha.108) (2023-11-21)
### Bug Fixes
* **core:** make sure stringifyValueWithType does not print unlimited depth ([56fbef9](https://github.com/deepkit/deepkit-framework/commit/56fbef908eb5e0c4d4c244123637182bb94f7145))
## [1.0.1-alpha.105](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.103...v1.0.1-alpha.105) (2023-10-23)
**Note:** Version bump only for package @deepkit/core

4

dist/cjs/src/compiler.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CompilerContext = void 0;
const __ΩPartial = ['T', 'l+e#!e"!fRb!Pde"!gN#"'];
const __ΩPartial = ['T', 'l+e#!e"!fRb!Pde"!gN#"y'];
/*

@@ -126,3 +126,3 @@ * Deepkit Framework

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', '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'];
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', 'CompilerContext', '\'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"/A0B5wC'];
//# sourceMappingURL=compiler.js.map

@@ -80,5 +80,5 @@ /**

/**
* Returns a human readable string representation from the given value.
* Returns a human-readable string representation from the given value.
*/
export declare function stringifyValueWithType(value: any): string;
export declare function stringifyValueWithType(value: any, depth?: number): string;
/**

@@ -104,3 +104,3 @@ * Changes the class of a given instance and returns the new object.

export declare function changeClass<T>(value: object, newClass: ClassType<T>): T;
export declare function prettyPrintObject(object: object): string;
export declare function prettyPrintObject(object: object, depth?: number): string;
/**

@@ -410,4 +410,5 @@ * Returns true if given obj is a function.

export declare function forwardTypeArguments(x: any, y: any): void;
export declare function formatError(error: any): string;
export declare type __ΩClassType = any[];
export declare type __ΩAbstractClassType = any[];
export declare type __ΩExtractClassType = any[];

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

exports.humanBytes = exports.deletePathValue = exports.setPathValue = exports.getPathValue = exports.time = exports.collectForMicrotask = exports.mergeStack = exports.createStack = exports.mergePromiseStack = exports.fixAsyncOperation = 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.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 = exports.getObjectKeysSize = void 0;
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-M'];
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8M'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$M'];
const __ΩPropertyKey = ['P&\'+J'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,M'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"J'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$M'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$M'];
exports.formatError = 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 = exports.getObjectKeysSize = void 0;
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-My'];
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8My'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$My'];
const __ΩPropertyKey = ['P&\'+Jy'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,My'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"Jy'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$My'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$My'];
function __assignType(fn, args) {

@@ -52,8 +52,8 @@ fn.__type = args;

exports.CustomError = CustomError;
CustomError.__type = [() => Error, 'name', 'stack', 'message', () => "", 'constructor', 'P7!&3"&3#8P&2$:>%"0&5'];
const __ΩClassType = ['T', 'args', 'new', '"c!PP"@2"e#!1#M'];
CustomError.__type = [() => Error, 'name', 'stack', 'message', () => "", 'constructor', 'CustomError', 'P7!&3"&3#8P&2$:>%"0&5w\''];
const __ΩClassType = ['T', 'args', 'new', '"c!PP"@2"e#!1#My'];
exports.__ΩClassType = __ΩClassType;
const __ΩAbstractClassType = ['T', 'args', 'new', '"c!P"@2"e"!/#'];
const __ΩAbstractClassType = ['T', 'args', 'new', '"c!P"@2"e"!/#y'];
exports.__ΩAbstractClassType = __ΩAbstractClassType;
const __ΩExtractClassType = ['T', () => __ΩAbstractClassType, 'l:e"!R!RPde#!h!!o""qk#\'QRb!Pde"!p)'];
const __ΩExtractClassType = ['T', () => __ΩAbstractClassType, 'l:e"!R!RPde#!h!!o""qk#\'QRb!Pde"!p)y'];
exports.__ΩExtractClassType = __ΩExtractClassType;

@@ -151,5 +151,5 @@ /**

/**
* Returns a human readable string representation from the given value.
* Returns a human-readable string representation from the given value.
*/
function stringifyValueWithType(value) {
function stringifyValueWithType(value, depth = 0) {
if ('string' === typeof value)

@@ -164,3 +164,3 @@ return `string(${value})`;

if (isPlainObject(value))
return `object ${prettyPrintObject(value)}`;
return `object ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if (isArray(value))

@@ -171,3 +171,3 @@ return `Array`;

if (isObject(value))
return `${getClassName(getClassTypeFromInstance(value))} ${prettyPrintObject(value)}`;
return `${getClassName(getClassTypeFromInstance(value))} ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if ('function' === typeof value)

@@ -180,3 +180,3 @@ return `function ${value.name}`;

exports.stringifyValueWithType = stringifyValueWithType;
stringifyValueWithType.__type = ['value', 'stringifyValueWithType', 'P"2!&/"'];
stringifyValueWithType.__type = ['value', 'depth', () => 0, 'stringifyValueWithType', 'P"2!\'2">#&/$'];
/**

@@ -206,6 +206,6 @@ * Changes the class of a given instance and returns the new object.

changeClass.__type = ['value', () => __ΩClassType, 'newClass', 'changeClass', 'P%2!"o""2#"/$'];
function prettyPrintObject(object) {
let res = [];
function prettyPrintObject(object, depth = 0) {
const res = [];
for (const i in object) {
res.push(i + ': ' + stringifyValueWithType(object[i]));
res.push(i + ': ' + stringifyValueWithType(object[i], depth + 1));
}

@@ -215,3 +215,3 @@ return '{' + res.join(',') + '}';

exports.prettyPrintObject = prettyPrintObject;
prettyPrintObject.__type = ['object', 'prettyPrintObject', 'P%2!&/"'];
prettyPrintObject.__type = ['object', 'depth', () => 0, 'prettyPrintObject', 'P%2!\'2">#&/$'];
/**

@@ -896,2 +896,13 @@ * Returns true if given obj is a function.

forwardTypeArguments.__type = ['x', 'y', 'forwardTypeArguments', 'P"2!"2"$/#'];
function formatError(error) {
if (error instanceof AggregateError) {
return error.errors.map(__assignType(v => formatError(v), ['v', '', 'P"2!"/"'])).join('\n');
}
if (error instanceof Error) {
return `${getClassName(error)}: ${error.message}`;
}
return String(error);
}
exports.formatError = formatError;
formatError.__type = ['error', 'formatError', 'P"2!&/"'];
//# sourceMappingURL=core.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.singleStack = exports.stack = exports.log = void 0;
const __ΩPropertyDescriptor = ['configurable', 'enumerable', 'value', 'writable', 'get', 'v', 'set', 'P)4!8)4"8"4#8)4$8P"1%P"2&$1\'M'];
const __ΩTypedPropertyDescriptor = ['T', 'enumerable', 'configurable', 'writable', 'value', '', 'get', 'set', 'b!P)4"8)4#8)4$8e"!4%8Pe#!/&4\'8Pe#!2%$/&4(8M'];
const __ΩPropertyDescriptor = ['configurable', 'enumerable', 'value', 'writable', 'get', 'v', 'set', 'P)4!8)4"8"4#8)4$8P"1%P"2&$1\'My'];
const __ΩTypedPropertyDescriptor = ['T', 'enumerable', 'configurable', 'writable', 'value', '', 'get', 'set', 'b!P)4"8)4#8)4$8e"!4%8Pe#!/&4\'8Pe#!2%$/&4(8My'];
function __assignType(fn, args) {

@@ -7,0 +7,0 @@ fn.__type = args;

@@ -14,4 +14,4 @@ "use strict";

const array_js_1 = require("./array.js");
const __ΩAsyncSubscriber = ['T', 'event', '', 'b!Pe"!2"P$`$J/#'];
const __ΩAsyncEventSubscription = ['', 'unsubscribe', 'PP$/!4"M'];
const __ΩAsyncSubscriber = ['T', 'event', '', 'b!Pe"!2"P$`$J/#y'];
const __ΩAsyncEventSubscription = ['', 'unsubscribe', 'PP$/!4"My'];
exports.__ΩAsyncEventSubscription = __ΩAsyncEventSubscription;

@@ -40,3 +40,3 @@ let asyncId = 0;

exports.AsyncEmitterEvent = AsyncEmitterEvent;
AsyncEmitterEvent.__type = ['stopPropagation', 'stop', 'P"0!P"0"5'];
AsyncEmitterEvent.__type = ['stopPropagation', 'stop', 'AsyncEmitterEvent', 'P"0!P"0"5w#'];
class AsyncEventEmitter {

@@ -71,3 +71,3 @@ constructor(parent) {

exports.AsyncEventEmitter = AsyncEventEmitter;
AsyncEventEmitter.__type = ['T', () => __ΩAsyncSubscriber, 'subscribers', function () { return []; }, () => AsyncEventEmitter, 'parent', 'constructor', () => __ΩAsyncSubscriber, 'callback', () => __ΩAsyncEventSubscription, 'subscribe', 'event', 'emit', 'hasSubscriptions', 'b!e!!o""F3#<>$PP"7%2&8<"0\'Pe"!o("2)n*0+Pe"!2,$`0-P)0.5'];
AsyncEventEmitter.__type = ['T', () => __ΩAsyncSubscriber, 'subscribers', function () { return []; }, () => AsyncEventEmitter, 'parent', 'constructor', () => __ΩAsyncSubscriber, 'callback', () => __ΩAsyncEventSubscription, 'subscribe', 'event', 'emit', 'hasSubscriptions', 'AsyncEventEmitter', 'b!e!!o""F3#<>$PP"7%2&8<"0\'Pe"!o("2)n*0+Pe"!2,$`0-P)0.5w/'];
//# sourceMappingURL=emitter.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getValidEnumValue = exports.isValidEnumValue = exports.getEnumKeyLabelMap = exports.getEnumValues = exports.getEnumLabels = exports.getEnumLabel = void 0;
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-M'];
const __ΩPropertyKey = ['P&\'+J'];
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-My'];
const __ΩPropertyKey = ['P&\'+Jy'];
function __assignType(fn, args) {

@@ -7,0 +7,0 @@ fn.__type = args;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eachPair = exports.each = exports.eachKey = void 0;
const __ΩArrayLike = ['T', 'length', 'b!P\'4"9\'e"!LM'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$M'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,M'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"J'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$M'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$M'];
const __ΩArrayLike = ['T', 'length', 'b!P\'4"9\'e"!LMy'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$My'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,My'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"Jy'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$My'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$My'];
eachKey.__type = [() => __ΩArrayLike, 'object', () => __ΩIterableIterator, 'eachKey', 'P"o!"2"\'o#"/$'];

@@ -11,0 +11,0 @@ eachKey.__type = ['object', () => __ΩIterableIterator, 'eachKey', 'P"2!&o""/#'];

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

exports.ParsedHost = ParsedHost;
ParsedHost.__type = ['host', function () { return '127.0.0.1'; }, 'port', function () { return 0; }, 'unixSocket', function () { return ''; }, 'toString', 'secure', () => false, 'getWebSocketUrl', () => false, 'getHttpUrl', '&3!>"\'3#>$&3%>&!!!P&0\'P)2(>)"0*P)2(>+"0,5'];
ParsedHost.__type = ['host', function () { return '127.0.0.1'; }, 'port', function () { return 0; }, 'unixSocket', function () { return ''; }, 'toString', 'secure', () => false, 'getWebSocketUrl', () => false, 'getHttpUrl', 'ParsedHost', '&3!>"\'3#>$&3%>&!!!P&0\'P)2(>)"0*P)2(>+"0,5w-'];
function parseHost(hostWithIpOrUnixPath) {

@@ -50,0 +50,0 @@ const parsedHost = new ParsedHost();

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

exports.ProcessLock = ProcessLock;
ProcessLock.__type = ['ttlTimeout', 'id', 'constructor', 'ttl', () => 0, 'timeout', () => 0, 'acquire', 'isLocked', () => 0, 'tryLock', 'unlock', '"3!<P&2":9"0#P\'2$>%\'2&>\'"0(P"0)P\'2$>*"0+P"0,5'];
ProcessLock.__type = ['ttlTimeout', 'id', 'constructor', 'ttl', () => 0, 'timeout', () => 0, 'acquire', 'isLocked', () => 0, 'tryLock', 'unlock', 'ProcessLock', '"3!<P&2":9"0#P\'2$>%\'2&>\'"0(P"0)P\'2$>*"0+P"0,5w-'];
class ProcessLocker {

@@ -137,3 +137,3 @@ /**

exports.ProcessLocker = ProcessLocker;
ProcessLocker.__type = ['id', 'ttl', () => 0, 'timeout', () => 0, () => ProcessLock, 'acquireLock', () => 0, () => ProcessLock, 'tryLock', 'isLocked', 'P&2!\'2">#\'2$>%P7&`0\'P&2!\'2">(PP7)-J`0*P&2!)0+5'];
ProcessLocker.__type = ['id', 'ttl', () => 0, 'timeout', () => 0, () => ProcessLock, 'acquireLock', () => 0, () => ProcessLock, 'tryLock', 'isLocked', 'ProcessLocker', 'P&2!\'2">#\'2$>%P7&`0\'P&2!\'2">(PP7)-J`0*P&2!)0+5w,'];
class Mutex {

@@ -155,3 +155,3 @@ unlock() {

exports.Mutex = Mutex;
Mutex.__type = ['promise', '', 'resolver', 'unlock', 'lock', '$`3!8<P"/"3#8<P$0$P$`0%5'];
Mutex.__type = ['promise', '', 'resolver', 'unlock', 'lock', 'Mutex', '$`3!8<P"/"3#8<P$0$P$`0%5w&'];
//# sourceMappingURL=process-locker.js.map

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

exports.Timer = Timer;
Timer.__type = ['timeoutTimers', function () { return []; }, '', 'cb', 'timeout', 'setTimeout', 'clear', '"F3!<>"PP$/#2$\'2%"0&P"0\'5'];
Timer.__type = ['timeoutTimers', function () { return []; }, '', 'cb', 'timeout', 'setTimeout', 'clear', 'Timer', '"F3!<>"PP$/#2$\'2%"0&P"0\'5w('];
//# sourceMappingURL=timer.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__ΩInject = exports.__ΩInjectMeta = void 0;
const __ΩInjectMeta = ['T', "inject", '__meta', '!c!PP!P."e$!GK4#8M'];
const __ΩInjectMeta = ['T', "inject", '__meta', '!c!PP!P."e$!GK4#8My'];
exports.__ΩInjectMeta = __ΩInjectMeta;
const __ΩInject = ['Type', 'Token', () => __ΩInjectMeta, 'b!!c"Pe"!e""o#"K'];
const __ΩInject = ['Type', 'Token', () => __ΩInjectMeta, 'b!!c"Pe"!e""o#"Ky'];
exports.__ΩInject = __ΩInject;
//# sourceMappingURL=types.js.map

@@ -1,2 +0,2 @@

const __ΩPartial = ['T', 'l+e#!e"!fRb!Pde"!gN#"'];
const __ΩPartial = ['T', 'l+e#!e"!fRb!Pde"!gN#"y'];
/*

@@ -122,3 +122,3 @@ * Deepkit Framework

}
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'];
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', 'CompilerContext', '\'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"/A0B5wC'];
//# sourceMappingURL=compiler.js.map

@@ -80,5 +80,5 @@ /**

/**
* Returns a human readable string representation from the given value.
* Returns a human-readable string representation from the given value.
*/
export declare function stringifyValueWithType(value: any): string;
export declare function stringifyValueWithType(value: any, depth?: number): string;
/**

@@ -104,3 +104,3 @@ * Changes the class of a given instance and returns the new object.

export declare function changeClass<T>(value: object, newClass: ClassType<T>): T;
export declare function prettyPrintObject(object: object): string;
export declare function prettyPrintObject(object: object, depth?: number): string;
/**

@@ -410,4 +410,5 @@ * Returns true if given obj is a function.

export declare function forwardTypeArguments(x: any, y: any): void;
export declare function formatError(error: any): string;
export declare type __ΩClassType = any[];
export declare type __ΩAbstractClassType = any[];
export declare type __ΩExtractClassType = any[];

@@ -1,9 +0,9 @@

const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-M'];
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8M'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$M'];
const __ΩPropertyKey = ['P&\'+J'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,M'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"J'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$M'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$M'];
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-My'];
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8My'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$My'];
const __ΩPropertyKey = ['P&\'+Jy'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,My'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"Jy'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$My'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$My'];
function __assignType(fn, args) {

@@ -43,8 +43,8 @@ fn.__type = args;

}
CustomError.__type = [() => Error, 'name', 'stack', 'message', () => "", 'constructor', 'P7!&3"&3#8P&2$:>%"0&5'];
const __ΩClassType = ['T', 'args', 'new', '"c!PP"@2"e#!1#M'];
CustomError.__type = [() => Error, 'name', 'stack', 'message', () => "", 'constructor', 'CustomError', 'P7!&3"&3#8P&2$:>%"0&5w\''];
const __ΩClassType = ['T', 'args', 'new', '"c!PP"@2"e#!1#My'];
export { __ΩClassType as __ΩClassType };
const __ΩAbstractClassType = ['T', 'args', 'new', '"c!P"@2"e"!/#'];
const __ΩAbstractClassType = ['T', 'args', 'new', '"c!P"@2"e"!/#y'];
export { __ΩAbstractClassType as __ΩAbstractClassType };
const __ΩExtractClassType = ['T', () => __ΩAbstractClassType, 'l:e"!R!RPde#!h!!o""qk#\'QRb!Pde"!p)'];
const __ΩExtractClassType = ['T', () => __ΩAbstractClassType, 'l:e"!R!RPde#!h!!o""qk#\'QRb!Pde"!p)y'];
export { __ΩExtractClassType as __ΩExtractClassType };

@@ -135,5 +135,5 @@ /**

/**
* Returns a human readable string representation from the given value.
* Returns a human-readable string representation from the given value.
*/
export function stringifyValueWithType(value) {
export function stringifyValueWithType(value, depth = 0) {
if ('string' === typeof value)

@@ -148,3 +148,3 @@ return `string(${value})`;

if (isPlainObject(value))
return `object ${prettyPrintObject(value)}`;
return `object ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if (isArray(value))

@@ -155,3 +155,3 @@ return `Array`;

if (isObject(value))
return `${getClassName(getClassTypeFromInstance(value))} ${prettyPrintObject(value)}`;
return `${getClassName(getClassTypeFromInstance(value))} ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if ('function' === typeof value)

@@ -163,3 +163,3 @@ return `function ${value.name}`;

}
stringifyValueWithType.__type = ['value', 'stringifyValueWithType', 'P"2!&/"'];
stringifyValueWithType.__type = ['value', 'depth', () => 0, 'stringifyValueWithType', 'P"2!\'2">#&/$'];
/**

@@ -188,10 +188,10 @@ * Changes the class of a given instance and returns the new object.

changeClass.__type = ['value', () => __ΩClassType, 'newClass', 'changeClass', 'P%2!"o""2#"/$'];
export function prettyPrintObject(object) {
let res = [];
export function prettyPrintObject(object, depth = 0) {
const res = [];
for (const i in object) {
res.push(i + ': ' + stringifyValueWithType(object[i]));
res.push(i + ': ' + stringifyValueWithType(object[i], depth + 1));
}
return '{' + res.join(',') + '}';
}
prettyPrintObject.__type = ['object', 'prettyPrintObject', 'P%2!&/"'];
prettyPrintObject.__type = ['object', 'depth', () => 0, 'prettyPrintObject', 'P%2!\'2">#&/$'];
/**

@@ -827,2 +827,12 @@ * Returns true if given obj is a function.

forwardTypeArguments.__type = ['x', 'y', 'forwardTypeArguments', 'P"2!"2"$/#'];
export function formatError(error) {
if (error instanceof AggregateError) {
return error.errors.map(__assignType(v => formatError(v), ['v', '', 'P"2!"/"'])).join('\n');
}
if (error instanceof Error) {
return `${getClassName(error)}: ${error.message}`;
}
return String(error);
}
formatError.__type = ['error', 'formatError', 'P"2!&/"'];
//# sourceMappingURL=core.js.map

@@ -1,3 +0,3 @@

const __ΩPropertyDescriptor = ['configurable', 'enumerable', 'value', 'writable', 'get', 'v', 'set', 'P)4!8)4"8"4#8)4$8P"1%P"2&$1\'M'];
const __ΩTypedPropertyDescriptor = ['T', 'enumerable', 'configurable', 'writable', 'value', '', 'get', 'set', 'b!P)4"8)4#8)4$8e"!4%8Pe#!/&4\'8Pe#!2%$/&4(8M'];
const __ΩPropertyDescriptor = ['configurable', 'enumerable', 'value', 'writable', 'get', 'v', 'set', 'P)4!8)4"8"4#8)4$8P"1%P"2&$1\'My'];
const __ΩTypedPropertyDescriptor = ['T', 'enumerable', 'configurable', 'writable', 'value', '', 'get', 'set', 'b!P)4"8)4#8)4$8e"!4%8Pe#!/&4\'8Pe#!2%$/&4(8My'];
function __assignType(fn, args) {

@@ -4,0 +4,0 @@ fn.__type = args;

@@ -11,4 +11,4 @@ /*

import { arrayRemoveItem } from './array.js';
const __ΩAsyncSubscriber = ['T', 'event', '', 'b!Pe"!2"P$`$J/#'];
const __ΩAsyncEventSubscription = ['', 'unsubscribe', 'PP$/!4"M'];
const __ΩAsyncSubscriber = ['T', 'event', '', 'b!Pe"!2"P$`$J/#y'];
const __ΩAsyncEventSubscription = ['', 'unsubscribe', 'PP$/!4"My'];
export { __ΩAsyncEventSubscription as __ΩAsyncEventSubscription };

@@ -36,3 +36,3 @@ let asyncId = 0;

}
AsyncEmitterEvent.__type = ['stopPropagation', 'stop', 'P"0!P"0"5'];
AsyncEmitterEvent.__type = ['stopPropagation', 'stop', 'AsyncEmitterEvent', 'P"0!P"0"5w#'];
export class AsyncEventEmitter {

@@ -66,3 +66,3 @@ constructor(parent) {

}
AsyncEventEmitter.__type = ['T', () => __ΩAsyncSubscriber, 'subscribers', function () { return []; }, () => AsyncEventEmitter, 'parent', 'constructor', () => __ΩAsyncSubscriber, 'callback', () => __ΩAsyncEventSubscription, 'subscribe', 'event', 'emit', 'hasSubscriptions', 'b!e!!o""F3#<>$PP"7%2&8<"0\'Pe"!o("2)n*0+Pe"!2,$`0-P)0.5'];
AsyncEventEmitter.__type = ['T', () => __ΩAsyncSubscriber, 'subscribers', function () { return []; }, () => AsyncEventEmitter, 'parent', 'constructor', () => __ΩAsyncSubscriber, 'callback', () => __ΩAsyncEventSubscription, 'subscribe', 'event', 'emit', 'hasSubscriptions', 'AsyncEventEmitter', 'b!e!!o""F3#<>$PP"7%2&8<"0\'Pe"!o("2)n*0+Pe"!2,$`0-P)0.5w/'];
//# sourceMappingURL=emitter.js.map

@@ -1,3 +0,3 @@

const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-M'];
const __ΩPropertyKey = ['P&\'+J'];
const __ΩObject = ['', 'constructor', 'toString', 'toLocaleString', 0, 'valueOf', () => __ΩPropertyKey, 'v', 'hasOwnProperty', 0, 'isPrototypeOf', () => __ΩPropertyKey, 'propertyIsEnumerable', 'PP"/!4"P&1#P&1$Pn%1&Pn\'2()1)Pn*2()1+Pn,2()1-My'];
const __ΩPropertyKey = ['P&\'+Jy'];
function __assignType(fn, args) {

@@ -4,0 +4,0 @@ fn.__type = args;

@@ -1,7 +0,7 @@

const __ΩArrayLike = ['T', 'length', 'b!P\'4"9\'e"!LM'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$M'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,M'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"J'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$M'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$M'];
const __ΩArrayLike = ['T', 'length', 'b!P\'4"9\'e"!LMy'];
const __ΩIterableIterator = ['T', () => __ΩIterator, 0, () => Symbol.iterator, 'b!Pe"!o""Pe#!o#"1$My'];
const __ΩIterator = ['T', 'TReturn', 'TNext', 'args', () => __ΩIteratorResult, 'next', 'value', () => __ΩIteratorResult, 'return', 'e', () => __ΩIteratorResult, 'throw', 'b!"c"-c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2\'8e#!e#"o(#1)P"2*8e#!e#"o+#1,My'];
const __ΩIteratorResult = ['T', 'TReturn', () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, 'b!"c"Pe"!o#"e""o$"Jy'];
const __ΩIteratorYieldResult = ['TYield', false, 'done', 'value', 'b!P."4#8e"!4$My'];
const __ΩIteratorReturnResult = ['TReturn', true, 'done', 'value', 'b!P."4#e"!4$My'];
eachKey.__type = [() => __ΩArrayLike, 'object', () => __ΩIterableIterator, 'eachKey', 'P"o!"2"\'o#"/$'];

@@ -8,0 +8,0 @@ eachKey.__type = ['object', () => __ΩIterableIterator, 'eachKey', 'P"2!&o""/#'];

@@ -43,3 +43,3 @@ /*

}
ParsedHost.__type = ['host', function () { return '127.0.0.1'; }, 'port', function () { return 0; }, 'unixSocket', function () { return ''; }, 'toString', 'secure', () => false, 'getWebSocketUrl', () => false, 'getHttpUrl', '&3!>"\'3#>$&3%>&!!!P&0\'P)2(>)"0*P)2(>+"0,5'];
ParsedHost.__type = ['host', function () { return '127.0.0.1'; }, 'port', function () { return 0; }, 'unixSocket', function () { return ''; }, 'toString', 'secure', () => false, 'getWebSocketUrl', () => false, 'getHttpUrl', 'ParsedHost', '&3!>"\'3#>$&3%>&!!!P&0\'P)2(>)"0*P)2(>+"0,5w-'];
export function parseHost(hostWithIpOrUnixPath) {

@@ -46,0 +46,0 @@ const parsedHost = new ParsedHost();

@@ -107,3 +107,3 @@ function __assignType(fn, args) {

}
ProcessLock.__type = ['ttlTimeout', 'id', 'constructor', 'ttl', () => 0, 'timeout', () => 0, 'acquire', 'isLocked', () => 0, 'tryLock', 'unlock', '"3!<P&2":9"0#P\'2$>%\'2&>\'"0(P"0)P\'2$>*"0+P"0,5'];
ProcessLock.__type = ['ttlTimeout', 'id', 'constructor', 'ttl', () => 0, 'timeout', () => 0, 'acquire', 'isLocked', () => 0, 'tryLock', 'unlock', 'ProcessLock', '"3!<P&2":9"0#P\'2$>%\'2&>\'"0(P"0)P\'2$>*"0+P"0,5w-'];
export class ProcessLocker {

@@ -132,3 +132,3 @@ /**

}
ProcessLocker.__type = ['id', 'ttl', () => 0, 'timeout', () => 0, () => ProcessLock, 'acquireLock', () => 0, () => ProcessLock, 'tryLock', 'isLocked', 'P&2!\'2">#\'2$>%P7&`0\'P&2!\'2">(PP7)-J`0*P&2!)0+5'];
ProcessLocker.__type = ['id', 'ttl', () => 0, 'timeout', () => 0, () => ProcessLock, 'acquireLock', () => 0, () => ProcessLock, 'tryLock', 'isLocked', 'ProcessLocker', 'P&2!\'2">#\'2$>%P7&`0\'P&2!\'2">(PP7)-J`0*P&2!)0+5w,'];
export class Mutex {

@@ -149,3 +149,3 @@ unlock() {

}
Mutex.__type = ['promise', '', 'resolver', 'unlock', 'lock', '$`3!8<P"/"3#8<P$0$P$`0%5'];
Mutex.__type = ['promise', '', 'resolver', 'unlock', 'lock', 'Mutex', '$`3!8<P"/"3#8<P$0$P$`0%5w&'];
//# sourceMappingURL=process-locker.js.map

@@ -28,3 +28,3 @@ /*

}
Timer.__type = ['timeoutTimers', function () { return []; }, '', 'cb', 'timeout', 'setTimeout', 'clear', '"F3!<>"PP$/#2$\'2%"0&P"0\'5'];
Timer.__type = ['timeoutTimers', function () { return []; }, '', 'cb', 'timeout', 'setTimeout', 'clear', 'Timer', '"F3!<>"PP$/#2$\'2%"0&P"0\'5w('];
//# sourceMappingURL=timer.js.map

@@ -1,5 +0,5 @@

const __ΩInjectMeta = ['T', "inject", '__meta', '!c!PP!P."e$!GK4#8M'];
const __ΩInjectMeta = ['T', "inject", '__meta', '!c!PP!P."e$!GK4#8My'];
export { __ΩInjectMeta as __ΩInjectMeta };
const __ΩInject = ['Type', 'Token', () => __ΩInjectMeta, 'b!!c"Pe"!e""o#"K'];
const __ΩInject = ['Type', 'Token', () => __ΩInjectMeta, 'b!!c"Pe"!e""o#"Ky'];
export { __ΩInject as __ΩInject };
//# sourceMappingURL=types.js.map
{
"name": "@deepkit/core",
"version": "1.0.1-alpha.105",
"version": "1.0.1-alpha.108",
"description": "Deepkit core library",

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

},
"gitHead": "f8a21ab4f142b0c047cd4ed00deb795f5c739cce"
"gitHead": "7f207009f9c18138e924521629c41ef56e4474a6"
}

@@ -137,5 +137,5 @@ /*

/**
* Returns a human readable string representation from the given value.
* Returns a human-readable string representation from the given value.
*/
export function stringifyValueWithType(value: any): string {
export function stringifyValueWithType(value: any, depth: number = 0): string {
if ('string' === typeof value) return `string(${value})`;

@@ -145,6 +145,6 @@ if ('number' === typeof value) return `number(${value})`;

if ('bigint' === typeof value) return `bigint(${value})`;
if (isPlainObject(value)) return `object ${prettyPrintObject(value)}`;
if (isPlainObject(value)) return `object ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if (isArray(value)) return `Array`;
if (isClass(value)) return `${getClassName(value)}`;
if (isObject(value)) return `${getClassName(getClassTypeFromInstance(value))} ${prettyPrintObject(value)}`;
if (isObject(value)) return `${getClassName(getClassTypeFromInstance(value))} ${depth < 2 ? prettyPrintObject(value, depth) : ''}`;
if ('function' === typeof value) return `function ${value.name}`;

@@ -178,6 +178,6 @@ if (null === value) return `null`;

export function prettyPrintObject(object: object): string {
let res: string[] = [];
export function prettyPrintObject(object: object, depth: number = 0): string {
const res: string[] = [];
for (const i in object) {
res.push(i + ': ' + stringifyValueWithType((object as any)[i]));
res.push(i + ': ' + stringifyValueWithType((object as any)[i], depth + 1));
}

@@ -819,1 +819,13 @@ return '{' + res.join(',') + '}';

}
export function formatError(error: any): string {
if (error instanceof AggregateError) {
return error.errors.map(v => formatError(v)).join('\n');
}
if (error instanceof Error) {
return `${getClassName(error)}: ${error.message}`;
}
return String(error);
}

@@ -11,3 +11,3 @@ {

"moduleResolution": "node",
"target": "es2018",
"target": "es2021",
"module": "CommonJS",

@@ -14,0 +14,0 @@ "esModuleInterop": true,

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