@powerlines/deepkit 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capnp.d.cts +1 -1
- package/dist/capnp.d.mts +1 -1
- package/dist/transformer.cjs +1 -1
- package/dist/transformer.mjs +1 -1
- package/dist/types.d.cts +3 -2
- package/dist/types.d.mts +3 -2
- package/dist/utilities.d.cts +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/vendor/core.d.cts +158 -637
- package/dist/vendor/core.d.mts +158 -637
- package/dist/vendor/core.mjs +2 -1
- package/dist/vendor/string-BuMgdahD.mjs +2 -1
- package/dist/vendor/type-2yMJb9Mw.d.cts +223 -0
- package/dist/vendor/type-DEpHWwMt.d.mts +223 -0
- package/dist/vendor/type-Dgeqs-rL.mjs +2 -1
- package/dist/vendor/type-spec.d.cts +2 -192
- package/dist/vendor/type-spec.d.mts +2 -192
- package/dist/vendor/type.d.cts +2311 -2581
- package/dist/vendor/type.d.mts +2311 -2581
- package/dist/vendor/type.mjs +2 -1
- package/dist/vendor/types-Ur6a2Srw.d.mts +511 -0
- package/dist/vendor/types-exLGvFgG.d.cts +511 -0
- package/package.json +7 -7
package/dist/vendor/core.d.mts
CHANGED
|
@@ -1,498 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @example
|
|
5
|
-
* ```
|
|
6
|
-
* class MyApiError extends CustomerError {}
|
|
7
|
-
*
|
|
8
|
-
* throw MyApiError() // prints MyApiError instead of simply "Error".
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class CustomError extends Error {
|
|
14
|
-
name: string;
|
|
15
|
-
constructor(...args: any[]);
|
|
16
|
-
}
|
|
17
|
-
export interface CustomError {
|
|
18
|
-
cause?: unknown;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export interface ClassType<T = any> {
|
|
24
|
-
new (...args: any[]): T;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export type AbstractClassType<T = any> = abstract new (...args: any[]) => T;
|
|
30
|
-
export type ExtractClassType<T> = T extends AbstractClassType<infer K> ? K : never;
|
|
31
|
-
/**
|
|
32
|
-
* Returns the class name either of the class definition or of the class of an instance.
|
|
33
|
-
*
|
|
34
|
-
* Note when code is minimized/uglified this output will change. You should disable in your compile the
|
|
35
|
-
* className modification.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* class User {}
|
|
40
|
-
*
|
|
41
|
-
* expect(getClassName(User)).toBe('User');
|
|
42
|
-
* expect(getClassName(new User())).toBe('User');
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @public
|
|
46
|
-
*/
|
|
47
|
-
export declare function getClassName<T>(classTypeOrInstance: ClassType<T> | Object): string;
|
|
48
|
-
/**
|
|
49
|
-
* Same as getClassName but appends the propertyName.
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
export declare function getClassPropertyName<T>(classType: ClassType<T> | Object, propertyName: string): string;
|
|
53
|
-
/**
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
56
|
-
export declare function applyDefaults<T>(classType: ClassType<T>, target: {
|
|
57
|
-
[k: string]: any;
|
|
58
|
-
}): T;
|
|
59
|
-
/**
|
|
60
|
-
* Tries to identify the object by normalised result of Object.toString(obj).
|
|
61
|
-
*/
|
|
62
|
-
export declare function identifyType(obj: any): string;
|
|
63
|
-
/**
|
|
64
|
-
* Returns true if the given obj is a plain object, and no class instance.
|
|
65
|
-
*
|
|
66
|
-
* isPlainObject(\{\}) === true
|
|
67
|
-
* isPlainObject(new ClassXY) === false
|
|
68
|
-
*
|
|
69
|
-
* @public
|
|
70
|
-
*/
|
|
71
|
-
export declare function isPlainObject(obj: any): obj is object;
|
|
72
|
-
/**
|
|
73
|
-
* Returns the ClassType for a given instance.
|
|
74
|
-
*/
|
|
75
|
-
export declare function getClassTypeFromInstance<T>(target: T): ClassType<T>;
|
|
76
|
-
/**
|
|
77
|
-
* Returns true when target is a class instance.
|
|
78
|
-
*/
|
|
79
|
-
export declare function isClassInstance(target: any): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Returns a human-readable string representation from the given value.
|
|
82
|
-
*/
|
|
83
|
-
export declare function stringifyValueWithType(value: any, depth?: number): string;
|
|
84
|
-
/**
|
|
85
|
-
* Changes the class of a given instance and returns the new object.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
*
|
|
90
|
-
* class Model1 {
|
|
91
|
-
* id: number = 0;
|
|
92
|
-
* }
|
|
93
|
-
*
|
|
94
|
-
* class Model2 {
|
|
95
|
-
* id: number = 0;
|
|
96
|
-
* }
|
|
97
|
-
*
|
|
98
|
-
* const model1 = new Model1();
|
|
99
|
-
* const model2 = changeClass(model1, Model2);
|
|
100
|
-
* model2 instanceof Model2; //true
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
export declare function changeClass<T>(value: object, newClass: ClassType<T>): T;
|
|
104
|
-
export declare function prettyPrintObject(object: object, depth?: number): string;
|
|
105
|
-
/**
|
|
106
|
-
* Returns true if given obj is a function.
|
|
107
|
-
*
|
|
108
|
-
* @public
|
|
109
|
-
*/
|
|
110
|
-
export declare function isFunction(obj: any): obj is Function;
|
|
111
|
-
export declare const AsyncFunction: {
|
|
112
|
-
new (...args: string[]): Function;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Returns true if given obj is a async function.
|
|
116
|
-
*
|
|
117
|
-
* @public
|
|
118
|
-
*/
|
|
119
|
-
export declare function isAsyncFunction(obj: any): obj is (...args: any[]) => Promise<any>;
|
|
120
|
-
/**
|
|
121
|
-
* Returns true if given obj is a promise like object.
|
|
122
|
-
*
|
|
123
|
-
* Note: There's not way to check if it's actually a Promise using instanceof since
|
|
124
|
-
* there are a lot of different implementations around.
|
|
125
|
-
*
|
|
126
|
-
* @public
|
|
127
|
-
*/
|
|
128
|
-
export declare function isPromise<T>(obj: any | Promise<T>): obj is Promise<T>;
|
|
129
|
-
/**
|
|
130
|
-
* Returns true if given obj is a ES6 class (ES5 fake classes are not supported).
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
export declare function isClass(obj: any): obj is AbstractClassType;
|
|
135
|
-
export declare function isGlobalClass(obj: any): obj is AbstractClassType;
|
|
136
|
-
/**
|
|
137
|
-
* Returns true for real objects: object literals ({}) or class instances (new MyClass).
|
|
138
|
-
*
|
|
139
|
-
* @public
|
|
140
|
-
*/
|
|
141
|
-
export declare function isObject(obj: any): obj is {
|
|
142
|
-
[key: string]: any;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Returns true if given obj is a plain object, and no Date, Array, Map, Set, etc.
|
|
146
|
-
*
|
|
147
|
-
* This is different to isObject and used in the type system to differentiate
|
|
148
|
-
* between JS objects in general and what we define as ReflectionKind.objectLiteral.
|
|
149
|
-
* Since we have Date, Set, Map, etc. in the type system, we need to differentiate
|
|
150
|
-
* between them and all other object literals.
|
|
151
|
-
*/
|
|
152
|
-
export declare function isObjectLiteral(obj: any): obj is {
|
|
153
|
-
[key: string]: any;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* @public
|
|
157
|
-
*/
|
|
158
|
-
export declare const isArray: (obj: any) => obj is any[];
|
|
159
|
-
/**
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
|
-
export declare function isNull(obj: any): obj is null;
|
|
163
|
-
/**
|
|
164
|
-
* @public
|
|
165
|
-
*/
|
|
166
|
-
export declare function isUndefined(obj: any): obj is undefined;
|
|
167
|
-
/**
|
|
168
|
-
* Checks if obj is not null and not undefined.
|
|
169
|
-
*
|
|
170
|
-
* @public
|
|
171
|
-
*/
|
|
172
|
-
export declare function isSet(obj: any): boolean;
|
|
173
|
-
/**
|
|
174
|
-
* @public
|
|
175
|
-
*/
|
|
176
|
-
export declare function isNumber(obj: any): obj is number;
|
|
177
|
-
/**
|
|
178
|
-
* Returns true if given value is strictly a numeric string value (or a number).
|
|
179
|
-
*
|
|
180
|
-
* ```typescript
|
|
181
|
-
* isNumeric(12); //true
|
|
182
|
-
* isNumeric('12'); //true
|
|
183
|
-
* isNumeric('12.3'); //true
|
|
184
|
-
* isNumeric('12.3 '); //false
|
|
185
|
-
* isNumeric('12px'); //false
|
|
186
|
-
* ```
|
|
187
|
-
* @public
|
|
188
|
-
*/
|
|
189
|
-
export declare function isNumeric(s: string | number): boolean;
|
|
190
|
-
export declare const isInteger: (obj: any) => obj is number;
|
|
191
|
-
/**
|
|
192
|
-
* @public
|
|
193
|
-
*/
|
|
194
|
-
export declare function isString(obj: any): obj is string;
|
|
195
|
-
/**
|
|
196
|
-
* @public
|
|
197
|
-
*/
|
|
198
|
-
export declare function indexOf<T>(array: T[], item: T): number;
|
|
199
|
-
/**
|
|
200
|
-
* @public
|
|
201
|
-
*/
|
|
202
|
-
export declare function sleep(seconds: number): Promise<void>;
|
|
203
|
-
/**
|
|
204
|
-
* Creates a shallow copy of given array.
|
|
205
|
-
*
|
|
206
|
-
* @public
|
|
207
|
-
*/
|
|
208
|
-
export declare function copy<T>(v: T[]): T[];
|
|
209
|
-
/**
|
|
210
|
-
* Checks whether given array or object is empty (no keys). If given object is falsy, returns false.
|
|
211
|
-
*
|
|
212
|
-
* @public
|
|
213
|
-
*/
|
|
214
|
-
export declare function empty<T>(value?: T[] | object | {}): boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Returns the size of given array or object.
|
|
217
|
-
*
|
|
218
|
-
* @public
|
|
219
|
-
*/
|
|
220
|
-
export declare function size<T>(array: T[] | {
|
|
221
|
-
[key: string]: T;
|
|
222
|
-
}): number;
|
|
223
|
-
/**
|
|
224
|
-
* Returns the first key of a given object.
|
|
225
|
-
*
|
|
226
|
-
* @public
|
|
227
|
-
*/
|
|
228
|
-
export declare function firstKey(v: {
|
|
229
|
-
[key: string]: any;
|
|
230
|
-
} | object): string | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* Returns the last key of a given object.
|
|
233
|
-
*
|
|
234
|
-
* @public
|
|
235
|
-
*/
|
|
236
|
-
export declare function lastKey(v: {
|
|
237
|
-
[key: string]: any;
|
|
238
|
-
} | object): string | undefined;
|
|
239
|
-
/**
|
|
240
|
-
* Returns the first value of given array or object.
|
|
241
|
-
*
|
|
242
|
-
* @public
|
|
243
|
-
*/
|
|
244
|
-
export declare function first<T>(v: {
|
|
245
|
-
[key: string]: T;
|
|
246
|
-
} | T[]): T | undefined;
|
|
247
|
-
/**
|
|
248
|
-
* Returns the last value of given array or object.
|
|
249
|
-
*
|
|
250
|
-
* @public
|
|
251
|
-
*/
|
|
252
|
-
export declare function last<T>(v: {
|
|
253
|
-
[key: string]: T;
|
|
254
|
-
} | T[]): T | undefined;
|
|
255
|
-
/**
|
|
256
|
-
* Returns the average of a number array.
|
|
257
|
-
*
|
|
258
|
-
* @public
|
|
259
|
-
*/
|
|
260
|
-
export declare function average(array: number[]): number;
|
|
261
|
-
/**
|
|
262
|
-
* @public
|
|
263
|
-
*/
|
|
264
|
-
export declare function prependObjectKeys(o: {
|
|
265
|
-
[k: string]: any;
|
|
266
|
-
}, prependText: string): {
|
|
267
|
-
[k: string]: any;
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* @public
|
|
271
|
-
*/
|
|
272
|
-
export declare function appendObject(origin: {
|
|
273
|
-
[k: string]: any;
|
|
274
|
-
}, extend: {
|
|
275
|
-
[k: string]: any;
|
|
276
|
-
}, prependKeyName?: string): void;
|
|
277
|
-
/**
|
|
278
|
-
* A better alternative to "new Promise()" that supports error handling and maintains the stack trace for Error.stack.
|
|
279
|
-
*
|
|
280
|
-
* When you use `new Promise()` you need to wrap your code inside a try-catch to call `reject` on error.
|
|
281
|
-
* asyncOperation() does this automatically.
|
|
282
|
-
*
|
|
283
|
-
* When you use `new Promise()` you will lose the stack trace when `reject(new Error())` is called.
|
|
284
|
-
* asyncOperation() makes sure the error stack trace is the correct one.
|
|
285
|
-
*
|
|
286
|
-
* @example
|
|
287
|
-
* ```typescript
|
|
288
|
-
* await asyncOperation(async (resolve, reject) => {
|
|
289
|
-
* await doSomething(); //if this fails, reject() will automatically be called
|
|
290
|
-
* stream.on('data', (data) => {
|
|
291
|
-
* resolve(data); //at some point you MUST call resolve(data)
|
|
292
|
-
* });
|
|
293
|
-
* });
|
|
294
|
-
* ```
|
|
295
|
-
*
|
|
296
|
-
* @public
|
|
297
|
-
* @reflection never
|
|
298
|
-
*/
|
|
299
|
-
export declare function asyncOperation<T>(executor: (resolve: (value: T) => void, reject: (error: any) => void) => void | Promise<void>): Promise<T>;
|
|
300
|
-
/**
|
|
301
|
-
* When an API is called that returns a promise that loses the stack trace on error, you can use fixAsyncOperation().
|
|
302
|
-
*
|
|
303
|
-
* ```typescript
|
|
304
|
-
* cons storage = new BrokenPromiseStorage();
|
|
305
|
-
* const files = await fixAsyncOperation(storage.files('/'));
|
|
306
|
-
* ```
|
|
307
|
-
*/
|
|
308
|
-
export declare function fixAsyncOperation<T>(promise: Promise<T>): Promise<T>;
|
|
309
|
-
/**
|
|
310
|
-
* @public
|
|
311
|
-
*/
|
|
312
|
-
export declare function mergePromiseStack<T>(promise: Promise<T>, stack?: string): Promise<T>;
|
|
313
|
-
/**
|
|
314
|
-
* @beta
|
|
315
|
-
*/
|
|
316
|
-
export declare function createStack(removeCallee?: boolean): string;
|
|
317
|
-
/**
|
|
318
|
-
* @beta
|
|
319
|
-
*/
|
|
320
|
-
export declare function mergeStack(error: Error, stack: string): void;
|
|
321
|
-
/**
|
|
322
|
-
* Makes sure the given value is an error. If it's not an error, it creates a new error with the given value as message.
|
|
323
|
-
*/
|
|
324
|
-
export declare function ensureError(error?: any, classType?: ClassType): Error;
|
|
325
|
-
export declare function collectForMicrotask<T>(callback: (args: T[]) => void): (arg: T) => void;
|
|
326
|
-
/**
|
|
327
|
-
* Returns the current time as seconds.
|
|
328
|
-
*
|
|
329
|
-
* @public
|
|
330
|
-
*/
|
|
331
|
-
export declare function time(): number;
|
|
332
|
-
/**
|
|
333
|
-
* @public
|
|
334
|
-
*/
|
|
335
|
-
export declare function getPathValue(bag: {
|
|
336
|
-
[field: string]: any;
|
|
337
|
-
}, parameterPath: string, defaultValue?: any): any;
|
|
338
|
-
/**
|
|
339
|
-
* @public
|
|
340
|
-
*/
|
|
341
|
-
export declare function setPathValue(bag: object, parameterPath: string, value: any): void;
|
|
342
|
-
/**
|
|
343
|
-
* @public
|
|
344
|
-
*/
|
|
345
|
-
export declare function deletePathValue(bag: object, parameterPath: string): void;
|
|
346
|
-
/**
|
|
347
|
-
* Returns the human-readable byte representation.
|
|
348
|
-
*
|
|
349
|
-
* @public
|
|
350
|
-
*/
|
|
351
|
-
export declare function humanBytes(bytes: number, si?: boolean): string;
|
|
352
|
-
/**
|
|
353
|
-
* Returns the number of properties on `obj`. This is 20x faster than Object.keys(obj).length.
|
|
354
|
-
*/
|
|
355
|
-
export declare function getObjectKeysSize(obj: object): number;
|
|
356
|
-
export declare function isConstructable(fn: any): boolean;
|
|
357
|
-
export declare function isPrototypeOfBase(prototype: AbstractClassType | undefined, base: ClassType): boolean;
|
|
358
|
-
export declare function getParentClass(classType: ClassType): ClassType | undefined;
|
|
359
|
-
export declare function getInheritanceChain(classType: ClassType): ClassType[];
|
|
360
|
-
export declare function inDebugMode(): boolean;
|
|
361
|
-
/**
|
|
362
|
-
* Create a new class with the given name.
|
|
363
|
-
* This is currently the only know way to make it workable in browsers too.
|
|
364
|
-
*/
|
|
365
|
-
export declare function createDynamicClass(name: string, base?: ClassType): ClassType;
|
|
366
|
-
export declare function isIterable(value: any): boolean;
|
|
367
|
-
export declare function iterableSize(value: Array<unknown> | Set<unknown> | Map<unknown, unknown>): number;
|
|
368
|
-
/**
|
|
369
|
-
* Returns __filename, works in both cjs and esm.
|
|
370
|
-
*/
|
|
371
|
-
export declare function getCurrentFileName(): string;
|
|
372
|
-
/**
|
|
373
|
-
* Escape special characters in a regex string, so it can be used as a literal string.
|
|
374
|
-
*/
|
|
375
|
-
export declare function escapeRegExp(string: string): string;
|
|
376
|
-
export declare function hasProperty(object: any, property: any): boolean;
|
|
377
|
-
/**
|
|
378
|
-
* Returns an iterator of numbers from start (inclusive) to stop (exclusive) by step.
|
|
379
|
-
*/
|
|
380
|
-
export declare function range(startOrLength: number, stop?: number, step?: number): IterableIterator<number>;
|
|
381
|
-
/**
|
|
382
|
-
* Returns an array of numbers from start (inclusive) to stop (exclusive) by step.
|
|
383
|
-
*
|
|
384
|
-
* Works the same as python's range function.
|
|
385
|
-
*/
|
|
386
|
-
export declare function rangeArray(startOrLength: number, stop?: number, step?: number): number[];
|
|
387
|
-
/**
|
|
388
|
-
* Returns a combined array of the given arrays.
|
|
389
|
-
*
|
|
390
|
-
* Works the same as python's zip function.
|
|
391
|
-
*/
|
|
392
|
-
export declare function zip<T extends (readonly unknown[])[]>(...args: T): {
|
|
393
|
-
[K in keyof T]: T[K] extends (infer V)[] ? V : never;
|
|
394
|
-
}[];
|
|
395
|
-
/**
|
|
396
|
-
* Forwards the runtime type arguments from function x to function y.
|
|
397
|
-
* This is necessary when a generic function is overridden and forwarded to something else.
|
|
398
|
-
*
|
|
399
|
-
* ```typescript
|
|
400
|
-
* let generic = <T>(type?: ReceiveType<T>) => undefined;
|
|
401
|
-
*
|
|
402
|
-
* let forwarded<T> = () => {
|
|
403
|
-
* forwardTypeArguments(forwarded, generic); //all type arguments are forwarded to generic()
|
|
404
|
-
* generic(); //call as usual
|
|
405
|
-
* }
|
|
406
|
-
*
|
|
407
|
-
* forwarded<any>(); //generic receives any in runtime.
|
|
408
|
-
* ```
|
|
409
|
-
*
|
|
410
|
-
* Note that generic.bind(this) will not work, as bind() creates a new function and forwarded type arguments can not
|
|
411
|
-
* reach the original function anymore.
|
|
412
|
-
*
|
|
413
|
-
* ```typescript
|
|
414
|
-
* let forwarded<T> = () => {
|
|
415
|
-
* const bound = generic.bind(this);
|
|
416
|
-
* forwardTypeArguments(forwarded, bound); //can not be forwarded anymore
|
|
417
|
-
* bound(); //fails
|
|
418
|
-
* }
|
|
419
|
-
* ```
|
|
420
|
-
*
|
|
421
|
-
* This is a limitation of JavaScript. In this case you have to manually forward type arguments.
|
|
422
|
-
*
|
|
423
|
-
* ```typescript
|
|
424
|
-
* let forwarded<T> = (type?: ReceiveType<T>) => {
|
|
425
|
-
* const bound = generic.bind(this);
|
|
426
|
-
* bound(type);
|
|
427
|
-
* }
|
|
428
|
-
* ```
|
|
429
|
-
*/
|
|
430
|
-
export declare function forwardTypeArguments(x: any, y: any): void;
|
|
431
|
-
export declare function formatError(error: any, withStack?: boolean): string;
|
|
432
|
-
/**
|
|
433
|
-
* Asserts that the given object is an instance of the given class.
|
|
434
|
-
*/
|
|
435
|
-
export declare function assertInstanceOf<T>(object: any, constructor: {
|
|
436
|
-
new (...args: any[]): T;
|
|
437
|
-
}): asserts object is T;
|
|
438
|
-
/**
|
|
439
|
-
* Asserts that the given value is defined (not null and not undefined).
|
|
440
|
-
*/
|
|
441
|
-
export declare function assertDefined<T>(value: T): asserts value is NonNullable<T>;
|
|
442
|
-
export declare type __ΩCustomError = any[];
|
|
443
|
-
export declare type __ΩClassType = any[];
|
|
444
|
-
export declare type __ΩAbstractClassType = any[];
|
|
445
|
-
export declare type __ΩExtractClassType = any[];
|
|
1
|
+
import { $ as isClassInstance, A as ensureError, At as zip, B as getCurrentFileName, C as changeClass, Ct as range, D as createStack, Dt as sleep, E as createDynamicClass, Et as size, F as formatError, G as hasProperty, H as getObjectKeysSize, I as forwardTypeArguments, J as inDebugMode, K as humanBytes, L as getClassName, M as first, N as firstKey, O as deletePathValue, Ot as stringifyValueWithType, P as fixAsyncOperation, Q as isClass, R as getClassPropertyName, S as average, St as prettyPrintObject, T as copy, Tt as setPathValue, U as getParentClass, V as getInheritanceChain, W as getPathValue, X as isArray, Y as indexOf, Z as isAsyncFunction, _ as appendObject, _t as last, a as __ΩInjectMeta, at as isNull, b as assertInstanceOf, bt as mergeStack, c as AbstractClassType, ct as isObject, d as CustomError, dt as isPromise, et as isConstructable, f as ExtractClassType, ft as isPrototypeOfBase, g as __ΩExtractClassType, gt as iterableSize, h as __ΩCustomError, ht as isUndefined, i as __ΩInject, it as isIterable, j as escapeRegExp, k as empty, kt as time, l as AsyncFunction, lt as isObjectLiteral, m as __ΩClassType, mt as isString, n as InjectMeta, nt as isGlobalClass, o as __ΩTypeAnnotation, ot as isNumber, p as __ΩAbstractClassType, pt as isSet, q as identifyType, r as TypeAnnotation, rt as isInteger, s as CompilerContext, st as isNumeric, t as Inject, tt as isFunction, u as ClassType, ut as isPlainObject, v as applyDefaults, vt as lastKey, w as collectForMicrotask, wt as rangeArray, x as asyncOperation, xt as prependObjectKeys, y as assertDefined, yt as mergePromiseStack, z as getClassTypeFromInstance } from "./types-Ur6a2Srw.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/decorators.d.ts
|
|
446
4
|
/**
|
|
447
5
|
* Logs every call to this method on stdout.
|
|
448
6
|
*
|
|
449
7
|
* @public
|
|
450
8
|
*/
|
|
451
|
-
|
|
9
|
+
declare function log(): (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
452
10
|
/**
|
|
453
11
|
* Makes sure that calls to this async method are stacked up and are called one after another and not parallel.
|
|
454
12
|
*
|
|
455
13
|
* @public
|
|
456
14
|
*/
|
|
457
|
-
|
|
15
|
+
declare function stack(): (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>) => void;
|
|
458
16
|
/**
|
|
459
17
|
* Makes sure that this async method is only running once at a time. When this method is running and it is tried
|
|
460
18
|
* to call it another times, that call is "dropped" and it returns simply the result of the previous running call (waiting for it to complete first).
|
|
461
19
|
*
|
|
462
20
|
* @public
|
|
463
21
|
*/
|
|
464
|
-
|
|
22
|
+
declare function singleStack(): (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => Promise<any>>) => void;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/enum.d.ts
|
|
465
25
|
/**
|
|
466
26
|
* Returns the enum label for a given enum value.
|
|
467
27
|
*
|
|
468
28
|
* @public
|
|
469
29
|
*/
|
|
470
|
-
|
|
471
|
-
|
|
30
|
+
declare function getEnumLabel(enumType: {
|
|
31
|
+
[field: string]: any;
|
|
472
32
|
}, id: any): any;
|
|
473
33
|
/**
|
|
474
34
|
* Returns all possible enum labels.
|
|
475
35
|
*
|
|
476
36
|
* @public
|
|
477
37
|
*/
|
|
478
|
-
|
|
38
|
+
declare function getEnumLabels(enumDefinition: any): string[];
|
|
479
39
|
/**
|
|
480
40
|
* Returns all possible enum keys.
|
|
481
41
|
*
|
|
482
42
|
* @public
|
|
483
43
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
44
|
+
declare function getEnumValues(enumDefinition: any): any[];
|
|
45
|
+
declare function getEnumKeyLabelMap(enumDefinition: any): Map<any, string>;
|
|
486
46
|
/**
|
|
487
47
|
* Checks whether given enum value is valid.
|
|
488
48
|
*
|
|
489
49
|
* @public
|
|
490
50
|
*/
|
|
491
|
-
|
|
51
|
+
declare function isValidEnumValue(enumDefinition: any, value: any, allowLabelsAsValue?: boolean): boolean;
|
|
492
52
|
/**
|
|
493
53
|
* @public
|
|
494
54
|
*/
|
|
495
|
-
|
|
55
|
+
declare function getValidEnumValue(enumDefinition: any, value: any, allowLabelsAsValue?: boolean): any;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/iterators.d.ts
|
|
496
58
|
/**
|
|
497
59
|
* Iterator for each key of an array or object.
|
|
498
60
|
*
|
|
@@ -506,10 +68,10 @@ export declare function getValidEnumValue(enumDefinition: any, value: any, allow
|
|
|
506
68
|
* @public
|
|
507
69
|
* @category iterator
|
|
508
70
|
*/
|
|
509
|
-
|
|
71
|
+
declare function eachKey<T>(object: ArrayLike<T>): IterableIterator<number>;
|
|
510
72
|
/** @public */
|
|
511
|
-
|
|
512
|
-
|
|
73
|
+
declare function eachKey<T extends {
|
|
74
|
+
[key: string]: any;
|
|
513
75
|
}, K extends keyof T>(object: T): IterableIterator<string>;
|
|
514
76
|
/**
|
|
515
77
|
* Iterator for each value of an array or object.
|
|
@@ -524,8 +86,8 @@ export declare function eachKey<T extends {
|
|
|
524
86
|
* @public
|
|
525
87
|
* @category iterator
|
|
526
88
|
*/
|
|
527
|
-
|
|
528
|
-
|
|
89
|
+
declare function each<T>(object: {
|
|
90
|
+
[s: string]: T;
|
|
529
91
|
} | ArrayLike<T>): IterableIterator<T>;
|
|
530
92
|
/**
|
|
531
93
|
* Iterator for key value pair of an array or object.
|
|
@@ -544,25 +106,23 @@ export declare function each<T>(object: {
|
|
|
544
106
|
* @public
|
|
545
107
|
* @category iterator
|
|
546
108
|
*/
|
|
547
|
-
|
|
548
|
-
number,
|
|
549
|
-
T
|
|
550
|
-
]>;
|
|
109
|
+
declare function eachPair<T>(object: ArrayLike<T>): IterableIterator<[number, T]>;
|
|
551
110
|
/** @public */
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}): IterableIterator<[
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
clear(): void;
|
|
111
|
+
declare function eachPair<T>(object: {
|
|
112
|
+
[s: string]: T;
|
|
113
|
+
}): IterableIterator<[string, T]>;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/timer.d.ts
|
|
116
|
+
declare class Timer {
|
|
117
|
+
protected timeoutTimers: any[];
|
|
118
|
+
setTimeout(cb: () => void, timeout: number): any;
|
|
119
|
+
/**
|
|
120
|
+
* Clears all timers at once.
|
|
121
|
+
*/
|
|
122
|
+
clear(): void;
|
|
565
123
|
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/process-locker.d.ts
|
|
566
126
|
/**
|
|
567
127
|
* This lock mechanism works only for one process (worker).
|
|
568
128
|
*
|
|
@@ -571,123 +131,100 @@ export declare class Timer {
|
|
|
571
131
|
* redislock: Very bad performance on high-load (when multiple locks on the same key `wait`, since it loops)
|
|
572
132
|
* mongodb lock: even worse performance than redis. Jesus.
|
|
573
133
|
*/
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
export declare class ProcessLocker {
|
|
585
|
-
/**
|
|
586
|
-
*
|
|
587
|
-
* @param id
|
|
588
|
-
* @param ttl optional defines when the times automatically unlocks.
|
|
589
|
-
* @param timeout if after `timeout` seconds the lock isn't acquired, it throws an error.
|
|
590
|
-
*/
|
|
591
|
-
acquireLock(id: string, ttl?: number, timeout?: number): Promise<ProcessLock>;
|
|
592
|
-
tryLock(id: string, ttl?: number): Promise<ProcessLock | undefined>;
|
|
593
|
-
isLocked(id: string): boolean;
|
|
134
|
+
declare class ProcessLock {
|
|
135
|
+
readonly id: string;
|
|
136
|
+
private holding;
|
|
137
|
+
protected ttlTimeout: any;
|
|
138
|
+
constructor(id: string);
|
|
139
|
+
acquire(ttl?: number, timeout?: number): Promise<void>;
|
|
140
|
+
isLocked(): boolean;
|
|
141
|
+
tryLock(ttl?: number): boolean;
|
|
142
|
+
unlock(): void;
|
|
594
143
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
144
|
+
declare class ProcessLocker {
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @param id
|
|
148
|
+
* @param ttl optional defines when the times automatically unlocks.
|
|
149
|
+
* @param timeout if after `timeout` seconds the lock isn't acquired, it throws an error.
|
|
150
|
+
*/
|
|
151
|
+
acquireLock(id: string, ttl?: number, timeout?: number): Promise<ProcessLock>;
|
|
152
|
+
tryLock(id: string, ttl?: number): Promise<ProcessLock | undefined>;
|
|
153
|
+
isLocked(id: string): boolean;
|
|
600
154
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
get isHostname(): boolean;
|
|
607
|
-
get hostWithIp(): string;
|
|
608
|
-
toString(): string;
|
|
609
|
-
getWebSocketUrl(secure?: boolean): string;
|
|
610
|
-
getHttpUrl(secure?: boolean): string;
|
|
155
|
+
declare class Mutex {
|
|
156
|
+
protected promise?: Promise<void>;
|
|
157
|
+
protected resolver?: Function;
|
|
158
|
+
unlock(): void;
|
|
159
|
+
lock(): Promise<void>;
|
|
611
160
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
* This helps for example to initialize dynamically some context variables.
|
|
625
|
-
*/
|
|
626
|
-
preCode: string;
|
|
627
|
-
initialiseVariables: string[];
|
|
628
|
-
config: {
|
|
629
|
-
indent: boolean;
|
|
630
|
-
};
|
|
631
|
-
constructor(config?: Partial<CompilerContext["config"]>);
|
|
632
|
-
reserveName(name: string): string;
|
|
633
|
-
set(values: {
|
|
634
|
-
[name: string]: any;
|
|
635
|
-
}): void;
|
|
636
|
-
/**
|
|
637
|
-
* Returns always the same variable name for the same value.
|
|
638
|
-
* The variable name should not be set afterwards.
|
|
639
|
-
*/
|
|
640
|
-
reserveConst(value: any, name?: string): string;
|
|
641
|
-
reserveVariable(name?: string, value?: any): string;
|
|
642
|
-
raw(functionCode: string): Function;
|
|
643
|
-
protected format(code: string): string;
|
|
644
|
-
build(functionCode: string, ...args: string[]): any;
|
|
645
|
-
buildAsync(functionCode: string, ...args: string[]): Function;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/network.d.ts
|
|
163
|
+
declare class ParsedHost {
|
|
164
|
+
host: string;
|
|
165
|
+
port: number;
|
|
166
|
+
unixSocket: string;
|
|
167
|
+
get isUnixSocket(): boolean;
|
|
168
|
+
get isHostname(): boolean;
|
|
169
|
+
get hostWithIp(): string;
|
|
170
|
+
toString(): string;
|
|
171
|
+
getWebSocketUrl(secure?: boolean): string;
|
|
172
|
+
getHttpUrl(secure?: boolean): string;
|
|
646
173
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
174
|
+
declare function parseHost(hostWithIpOrUnixPath: string): ParsedHost;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/perf.d.ts
|
|
177
|
+
declare function toFastProperties(obj: any): void;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/string.d.ts
|
|
180
|
+
declare function indent(indentation: number, prefix?: string): (str?: string) => string;
|
|
181
|
+
declare function capitalize(string: string): string;
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/emitter.d.ts
|
|
184
|
+
type AsyncSubscriber<T> = (event: T) => Promise<void> | void;
|
|
185
|
+
type Subscriber<T> = (event: T) => Promise<void> | void;
|
|
186
|
+
type AsyncEventSubscription = {
|
|
187
|
+
unsubscribe: () => void;
|
|
653
188
|
};
|
|
654
|
-
|
|
655
|
-
|
|
189
|
+
type EventSubscription = {
|
|
190
|
+
unsubscribe: () => void;
|
|
656
191
|
};
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
192
|
+
declare class EmitterEvent {
|
|
193
|
+
readonly id: number;
|
|
194
|
+
stopped: boolean;
|
|
195
|
+
propagationStopped: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Stop propagating the event to subsequent event listeners.
|
|
198
|
+
*/
|
|
199
|
+
stopPropagation(): void;
|
|
200
|
+
/**
|
|
201
|
+
* Signal the emitter that you want to abort.
|
|
202
|
+
* Subsequent event listeners will still be called.
|
|
203
|
+
*/
|
|
204
|
+
stop(): void;
|
|
670
205
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
206
|
+
declare class EventEmitter<T extends EmitterEvent> {
|
|
207
|
+
protected parent?: EventEmitter<any> | undefined;
|
|
208
|
+
protected subscribers: Subscriber<T>[];
|
|
209
|
+
constructor(parent?: EventEmitter<any> | undefined);
|
|
210
|
+
subscribe(callback: Subscriber<T>): EventSubscription;
|
|
211
|
+
emit(event: T): void;
|
|
212
|
+
hasSubscriptions(): boolean;
|
|
678
213
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
214
|
+
declare class AsyncEventEmitter<T extends EmitterEvent> {
|
|
215
|
+
protected parent?: AsyncEventEmitter<any> | undefined;
|
|
216
|
+
protected subscribers: AsyncSubscriber<T>[];
|
|
217
|
+
constructor(parent?: AsyncEventEmitter<any> | undefined);
|
|
218
|
+
subscribe(callback: AsyncSubscriber<T>): AsyncEventSubscription;
|
|
219
|
+
emit(event: T): Promise<void>;
|
|
220
|
+
hasSubscriptions(): boolean;
|
|
686
221
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
222
|
+
declare type __ΩAsyncEventSubscription = any[];
|
|
223
|
+
declare type __ΩEventSubscription = any[];
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/reactive.d.ts
|
|
226
|
+
declare const nextTick: (cb: () => void) => any;
|
|
227
|
+
declare const clearTick: (id: any) => any;
|
|
691
228
|
/**
|
|
692
229
|
* Wraps a function and calls it only `cps` times per frame.
|
|
693
230
|
*
|
|
@@ -707,35 +244,41 @@ export declare const clearTick: (id: any) => any;
|
|
|
707
244
|
* //throttled will here only be called once
|
|
708
245
|
* ```
|
|
709
246
|
*/
|
|
710
|
-
|
|
247
|
+
declare function throttleTime(call: Function, cps?: number): (...args: any[]) => void;
|
|
711
248
|
/**
|
|
712
249
|
* This functions returns a stack that is filled as long as the gate is not activated.
|
|
713
250
|
* Once activated all recorded calls go to given callback and subsequent calls go directly to given callback.
|
|
714
251
|
*/
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
252
|
+
declare function bufferedGate<T>(callback: (arg: T) => any): {
|
|
253
|
+
activate: () => void;
|
|
254
|
+
call: (i: T) => void;
|
|
718
255
|
};
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/reflection.d.ts
|
|
258
|
+
declare function extractParameters(fn: string | Function | ClassType): string[];
|
|
259
|
+
declare function extractMethodBody(classCode: string, name: string): string;
|
|
260
|
+
declare function removeStrings(code: string): string;
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/url.d.ts
|
|
263
|
+
declare function urlJoin(...path: string[]): string;
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/array.d.ts
|
|
723
266
|
/**
|
|
724
267
|
* @public
|
|
725
268
|
*/
|
|
726
|
-
|
|
269
|
+
declare function arrayHasItem<T>(array: T[], item: T): boolean;
|
|
727
270
|
/**
|
|
728
271
|
* Clears the array so its empty. Returns the amount of removed items.
|
|
729
272
|
*
|
|
730
273
|
* @public
|
|
731
274
|
*/
|
|
732
|
-
|
|
275
|
+
declare function arrayClear<T>(array: T[]): number;
|
|
733
276
|
/**
|
|
734
277
|
* Removes on particular item by reference of an array.
|
|
735
278
|
*
|
|
736
279
|
* @public
|
|
737
280
|
*/
|
|
738
|
-
|
|
281
|
+
declare function arrayRemoveItem<T>(array: T[], item: T): boolean;
|
|
739
282
|
/**
|
|
740
283
|
* Moves a particular item in an array up or down (move>0=down, move<0=up).
|
|
741
284
|
* Changes the array itself.
|
|
@@ -756,72 +299,50 @@ export declare function arrayRemoveItem<T>(array: T[], item: T): boolean;
|
|
|
756
299
|
*
|
|
757
300
|
* @public
|
|
758
301
|
*/
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
*
|
|
763
|
-
* Adds runtime meta information to a type without influencing the type itself.
|
|
764
|
-
* This is like an intrinsic type, but only for runtime.
|
|
765
|
-
*
|
|
766
|
-
* ```typescript
|
|
767
|
-
* import { TypeAnnotation } from '@deepkit/core';
|
|
768
|
-
* import { typeAnnotation } from '@deepkit/type';
|
|
769
|
-
*
|
|
770
|
-
* type PrimaryKey = TypeAnnotation<'primaryKey'>;
|
|
771
|
-
* type UserId = string & PrimaryKey;
|
|
772
|
-
*
|
|
773
|
-
* const type = typeOf<UserId>();
|
|
774
|
-
* const metaData = typeAnnotation.getType(type, 'primaryKey');
|
|
775
|
-
* ```
|
|
776
|
-
*
|
|
777
|
-
* Runtime type is `{ __meta?: never & [T, Options] };`
|
|
778
|
-
*
|
|
779
|
-
* @intrinsic
|
|
780
|
-
*/
|
|
781
|
-
export type TypeAnnotation<T extends string, Options = never> = unknown;
|
|
782
|
-
export type InjectMeta<T = never> = TypeAnnotation<"inject", T>;
|
|
783
|
-
export type Inject<Type, Token = never> = Type & InjectMeta<Token>;
|
|
784
|
-
export declare type __ΩTypeAnnotation = any[];
|
|
785
|
-
export declare type __ΩInjectMeta = any[];
|
|
786
|
-
export declare type __ΩInject = any[];
|
|
302
|
+
declare function arrayMoveItem<A extends T[], T>(array: A, item: T, move: number): A;
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/buffer.d.ts
|
|
787
305
|
/**
|
|
788
306
|
* Create a buffer of the given size (uninitialized, so it may contain random data).
|
|
789
307
|
*
|
|
790
308
|
* Note that the result is either Uin8Array or Buffer, depending on the environment.
|
|
791
309
|
* Buffer from NodeJS works slightly different than Uint8Array.
|
|
792
310
|
*/
|
|
793
|
-
|
|
311
|
+
declare const createBuffer: (size: number) => Uint8Array;
|
|
794
312
|
/**
|
|
795
313
|
* Concat multiple buffers into one.
|
|
796
314
|
*/
|
|
797
|
-
|
|
798
|
-
|
|
315
|
+
declare function bufferConcat(chunks: Uint8Array[], length?: number): Uint8Array;
|
|
316
|
+
declare const uint8ArrayToUtf8: (buffer: Uint8Array) => any;
|
|
799
317
|
/**
|
|
800
318
|
* Convert a buffer to a string.
|
|
801
319
|
*/
|
|
802
|
-
|
|
803
|
-
|
|
320
|
+
declare function bufferToString(buffer: string | Uint8Array): string;
|
|
321
|
+
declare function nativeBase64ToUint8Array(base64: string): Uint8Array;
|
|
804
322
|
/**
|
|
805
323
|
* Converts a base64 string to a Uint8Array.
|
|
806
324
|
*/
|
|
807
|
-
|
|
325
|
+
declare const base64ToUint8Array: (v: string) => Uint8Array;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/path.d.ts
|
|
808
328
|
/**
|
|
809
329
|
* Normalizes the given path.
|
|
810
330
|
* Removes duplicate slashes, removes trailing slashes, adds a leading slash.
|
|
811
331
|
*/
|
|
812
|
-
|
|
332
|
+
declare function pathNormalize(path: string): string;
|
|
813
333
|
/**
|
|
814
334
|
* Returns the directory (dirname) of the given path.
|
|
815
335
|
*/
|
|
816
|
-
|
|
336
|
+
declare function pathDirectory(path: string): string;
|
|
817
337
|
/**
|
|
818
338
|
* Returns the basename of the given path.
|
|
819
339
|
*/
|
|
820
|
-
|
|
340
|
+
declare function pathBasename(path: string): string;
|
|
821
341
|
/**
|
|
822
342
|
* Returns the extension of the given path.
|
|
823
343
|
*/
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
export {};
|
|
344
|
+
declare function pathExtension(path: string): string;
|
|
345
|
+
declare function pathJoin(...paths: string[]): string;
|
|
346
|
+
//#endregion
|
|
347
|
+
export { AbstractClassType, AsyncEventEmitter, AsyncEventSubscription, AsyncFunction, ClassType, CompilerContext, CustomError, EmitterEvent, EventEmitter, EventSubscription, ExtractClassType, Inject, InjectMeta, Mutex, ParsedHost, ProcessLock, ProcessLocker, Timer, TypeAnnotation, __ΩAbstractClassType, __ΩAsyncEventSubscription, __ΩClassType, __ΩCustomError, __ΩEventSubscription, __ΩExtractClassType, __ΩInject, __ΩInjectMeta, __ΩTypeAnnotation, appendObject, applyDefaults, arrayClear, arrayHasItem, arrayMoveItem, arrayRemoveItem, assertDefined, assertInstanceOf, asyncOperation, average, base64ToUint8Array, bufferConcat, bufferToString, bufferedGate, capitalize, changeClass, clearTick, collectForMicrotask, copy, createBuffer, createDynamicClass, createStack, deletePathValue, each, eachKey, eachPair, empty, ensureError, escapeRegExp, extractMethodBody, extractParameters, first, firstKey, fixAsyncOperation, formatError, forwardTypeArguments, getClassName, getClassPropertyName, getClassTypeFromInstance, getCurrentFileName, getEnumKeyLabelMap, getEnumLabel, getEnumLabels, getEnumValues, getInheritanceChain, getObjectKeysSize, getParentClass, getPathValue, getValidEnumValue, hasProperty, humanBytes, identifyType, inDebugMode, indent, indexOf, isArray, isAsyncFunction, isClass, isClassInstance, isConstructable, isFunction, isGlobalClass, isInteger, isIterable, isNull, isNumber, isNumeric, isObject, isObjectLiteral, isPlainObject, isPromise, isPrototypeOfBase, isSet, isString, isUndefined, isValidEnumValue, iterableSize, last, lastKey, log, mergePromiseStack, mergeStack, nativeBase64ToUint8Array, nextTick, parseHost, pathBasename, pathDirectory, pathExtension, pathJoin, pathNormalize, prependObjectKeys, prettyPrintObject, range, rangeArray, removeStrings, setPathValue, singleStack, size, sleep, stack, stringifyValueWithType, throttleTime, time, toFastProperties, uint8ArrayToUtf8, urlJoin, zip };
|
|
348
|
+
//# sourceMappingURL=core.d.mts.map
|