@tsed/core 7.0.0-beta.2 → 7.0.0-beta.20
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/coverage.json +6 -0
- package/jest.config.js +9 -0
- package/lib/cjs/decorators/configurable.js +2 -6
- package/lib/cjs/decorators/configurable.js.map +1 -1
- package/lib/cjs/decorators/deprecated.js +2 -1
- package/lib/cjs/decorators/deprecated.js.map +1 -1
- package/lib/cjs/decorators/enumerable.js +2 -6
- package/lib/cjs/decorators/enumerable.js.map +1 -1
- package/lib/cjs/decorators/notConfigurable.js +0 -4
- package/lib/cjs/decorators/notConfigurable.js.map +1 -1
- package/lib/cjs/decorators/notEnumerable.js +0 -4
- package/lib/cjs/decorators/notEnumerable.js.map +1 -1
- package/lib/cjs/decorators/readOnly.js +0 -4
- package/lib/cjs/decorators/readOnly.js.map +1 -1
- package/lib/cjs/decorators/writable.js +2 -6
- package/lib/cjs/decorators/writable.js.map +1 -1
- package/lib/cjs/domain/AnyToPromise.js +17 -19
- package/lib/cjs/domain/AnyToPromise.js.map +1 -1
- package/lib/cjs/domain/Hooks.js +22 -18
- package/lib/cjs/domain/Hooks.js.map +1 -1
- package/lib/cjs/domain/Metadata.js +5 -5
- package/lib/cjs/domain/Metadata.js.map +1 -1
- package/lib/cjs/domain/Store.js +1 -3
- package/lib/cjs/domain/Store.js.map +1 -1
- package/lib/cjs/errors/UnsupportedDecoratorType.js +6 -3
- package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -1
- package/lib/cjs/index.js +81 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/utils/decorators/decorateMethodsOf.js +10 -4
- package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -1
- package/lib/cjs/utils/imports/importPackage.js +5 -1
- package/lib/cjs/utils/imports/importPackage.js.map +1 -1
- package/lib/cjs/utils/objects/deepClone.js +6 -0
- package/lib/cjs/utils/objects/deepClone.js.map +1 -1
- package/lib/cjs/utils/objects/deepMerge.js.map +1 -1
- package/lib/cjs/utils/objects/descriptorOf.js +1 -2
- package/lib/cjs/utils/objects/descriptorOf.js.map +1 -1
- package/lib/cjs/utils/objects/getConstructorArgNames.js +6 -1
- package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -1
- package/lib/cjs/utils/objects/getValue.js +1 -1
- package/lib/cjs/utils/objects/getValue.js.map +1 -1
- package/lib/cjs/utils/objects/isBuffer.js +13 -0
- package/lib/cjs/utils/objects/isBuffer.js.map +1 -0
- package/lib/cjs/utils/objects/isClass.js +3 -1
- package/lib/cjs/utils/objects/isClass.js.map +1 -1
- package/lib/cjs/utils/objects/methodsOf.js.map +1 -1
- package/lib/esm/decorators/configurable.js +1 -5
- package/lib/esm/decorators/configurable.js.map +1 -1
- package/lib/esm/decorators/deprecated.js +2 -1
- package/lib/esm/decorators/deprecated.js.map +1 -1
- package/lib/esm/decorators/enumerable.js +1 -5
- package/lib/esm/decorators/enumerable.js.map +1 -1
- package/lib/esm/decorators/notConfigurable.js +1 -5
- package/lib/esm/decorators/notConfigurable.js.map +1 -1
- package/lib/esm/decorators/notEnumerable.js +1 -5
- package/lib/esm/decorators/notEnumerable.js.map +1 -1
- package/lib/esm/decorators/readOnly.js +1 -5
- package/lib/esm/decorators/readOnly.js.map +1 -1
- package/lib/esm/decorators/storeFn.js +1 -1
- package/lib/esm/decorators/storeMerge.js +1 -1
- package/lib/esm/decorators/storeSet.js +1 -1
- package/lib/esm/decorators/writable.js +1 -5
- package/lib/esm/decorators/writable.js.map +1 -1
- package/lib/esm/domain/AnyToPromise.js +20 -22
- package/lib/esm/domain/AnyToPromise.js.map +1 -1
- package/lib/esm/domain/Hooks.js +22 -18
- package/lib/esm/domain/Hooks.js.map +1 -1
- package/lib/esm/domain/Metadata.js +6 -6
- package/lib/esm/domain/Metadata.js.map +1 -1
- package/lib/esm/domain/Store.js +9 -11
- package/lib/esm/domain/Store.js.map +1 -1
- package/lib/esm/errors/UnsupportedDecoratorType.js +4 -1
- package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -1
- package/lib/esm/index.js +81 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/decorators/decorateMethodsOf.js +13 -7
- package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -1
- package/lib/esm/utils/decorators/decoratorArgs.js +1 -1
- package/lib/esm/utils/decorators/decoratorTypeOf.js +2 -2
- package/lib/esm/utils/decorators/inheritedDescriptorOf.js +1 -1
- package/lib/esm/utils/decorators/useMethodDecorators.js +1 -1
- package/lib/esm/utils/objects/ancestorsOf.js +3 -3
- package/lib/esm/utils/objects/cleanObject.js +1 -1
- package/lib/esm/utils/objects/createInstance.js +1 -1
- package/lib/esm/utils/objects/deepClone.js +12 -6
- package/lib/esm/utils/objects/deepClone.js.map +1 -1
- package/lib/esm/utils/objects/deepMerge.js +5 -5
- package/lib/esm/utils/objects/deepMerge.js.map +1 -1
- package/lib/esm/utils/objects/descriptorOf.js +1 -2
- package/lib/esm/utils/objects/descriptorOf.js.map +1 -1
- package/lib/esm/utils/objects/getClassOrSymbol.js +2 -2
- package/lib/esm/utils/objects/getConstructorArgNames.js +7 -2
- package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -1
- package/lib/esm/utils/objects/getEnumerableKeys.js +2 -2
- package/lib/esm/utils/objects/getValue.js +4 -4
- package/lib/esm/utils/objects/getValue.js.map +1 -1
- package/lib/esm/utils/objects/isArrowFn.js +1 -1
- package/lib/esm/utils/objects/isBuffer.js +9 -0
- package/lib/esm/utils/objects/isBuffer.js.map +1 -0
- package/lib/esm/utils/objects/isClass.js +10 -8
- package/lib/esm/utils/objects/isClass.js.map +1 -1
- package/lib/esm/utils/objects/isCollection.js +1 -1
- package/lib/esm/utils/objects/isEmpty.js +1 -1
- package/lib/esm/utils/objects/isEnumerable.js +2 -2
- package/lib/esm/utils/objects/isInheritedFrom.js +3 -3
- package/lib/esm/utils/objects/isPlainObject.js +1 -1
- package/lib/esm/utils/objects/isPrimitive.js +3 -3
- package/lib/esm/utils/objects/isSerializable.js +5 -5
- package/lib/esm/utils/objects/methodsOf.js +3 -3
- package/lib/esm/utils/objects/methodsOf.js.map +1 -1
- package/lib/esm/utils/objects/objectKeys.js +1 -1
- package/lib/esm/utils/objects/primitiveOf.js +3 -3
- package/lib/esm/utils/objects/prototypeOf.js +1 -1
- package/lib/esm/utils/objects/setValue.js +1 -1
- package/lib/esm/utils/objects/toMap.js +2 -2
- package/lib/esm/utils/objects/toStringConstructor.js +1 -1
- package/lib/esm/utils/proxyDelegation.js +1 -1
- package/lib/types/decorators/configurable.d.ts +0 -1
- package/lib/types/decorators/enumerable.d.ts +0 -1
- package/lib/types/decorators/notConfigurable.d.ts +0 -1
- package/lib/types/decorators/notEnumerable.d.ts +0 -1
- package/lib/types/decorators/readOnly.d.ts +0 -1
- package/lib/types/decorators/writable.d.ts +0 -1
- package/lib/types/domain/Hooks.d.ts +3 -2
- package/lib/types/index.d.ts +80 -5
- package/lib/types/utils/objects/deepMerge.d.ts +1 -1
- package/lib/types/utils/objects/isBuffer.d.ts +7 -0
- package/lib/types/utils/objects/methodsOf.d.ts +5 -1
- package/package.json +12 -6
- package/readme.md +4 -4
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/decorators/index.js +0 -18
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -11
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -3
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -19
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/objects/index.js +0 -46
- package/lib/cjs/utils/objects/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -15
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -8
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -2
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/utils/index.js +0 -16
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/esm/utils/objects/index.js +0 -43
- package/lib/esm/utils/objects/index.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -14
- package/lib/types/domain/index.d.ts +0 -7
- package/lib/types/interfaces/index.d.ts +0 -4
- package/lib/types/utils/index.d.ts +0 -13
- package/lib/types/utils/objects/index.d.ts +0 -42
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./decorators";
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./decorators/configurable.js";
|
|
5
|
+
export * from "./decorators/deprecated.js";
|
|
6
|
+
export * from "./decorators/enumerable.js";
|
|
7
|
+
export * from "./decorators/notConfigurable.js";
|
|
8
|
+
export * from "./decorators/notEnumerable.js";
|
|
9
|
+
export * from "./decorators/readOnly.js";
|
|
10
|
+
export * from "./decorators/storeFn.js";
|
|
11
|
+
export * from "./decorators/storeMerge.js";
|
|
12
|
+
export * from "./decorators/storeSet.js";
|
|
13
|
+
export * from "./decorators/writable.js";
|
|
14
|
+
export * from "./domain/AnyToPromise.js";
|
|
15
|
+
export * from "./domain/DecoratorTypes.js";
|
|
16
|
+
export * from "./domain/Env.js";
|
|
17
|
+
export * from "./domain/Hooks.js";
|
|
18
|
+
export * from "./domain/Metadata.js";
|
|
19
|
+
export * from "./domain/Store.js";
|
|
20
|
+
export * from "./domain/Type.js";
|
|
21
|
+
export * from "./errors/UnsupportedDecoratorType.js";
|
|
22
|
+
export * from "./interfaces/AnyDecorator.js";
|
|
23
|
+
export * from "./interfaces/DecoratorParameters.js";
|
|
24
|
+
export * from "./interfaces/HashOf.js";
|
|
25
|
+
export * from "./interfaces/MetadataTypes.js";
|
|
26
|
+
export * from "./interfaces/ValueOf.js";
|
|
27
|
+
export * from "./utils/catchError.js";
|
|
28
|
+
export * from "./utils/proxyDelegation.js";
|
|
29
|
+
export * from "./utils/uniq.js";
|
|
30
|
+
export * from "./utils/decorators/decorateMethodsOf.js";
|
|
31
|
+
export * from "./utils/decorators/decoratorArgs.js";
|
|
32
|
+
export * from "./utils/decorators/decoratorTypeOf.js";
|
|
33
|
+
export * from "./utils/decorators/inheritedDescriptorOf.js";
|
|
34
|
+
export * from "./utils/decorators/useDecorators.js";
|
|
35
|
+
export * from "./utils/decorators/useMethodDecorators.js";
|
|
36
|
+
export * from "./utils/http/getHostInfoFromPort.js";
|
|
37
|
+
export * from "./utils/imports/importPackage.js";
|
|
38
|
+
export * from "./utils/objects/ancestorOf.js";
|
|
39
|
+
export * from "./utils/objects/ancestorsOf.js";
|
|
40
|
+
export * from "./utils/objects/classOf.js";
|
|
41
|
+
export * from "./utils/objects/cleanObject.js";
|
|
42
|
+
export * from "./utils/objects/constructorOf.js";
|
|
43
|
+
export * from "./utils/objects/createInstance.js";
|
|
44
|
+
export * from "./utils/objects/deepClone.js";
|
|
45
|
+
export * from "./utils/objects/deepMerge.js";
|
|
46
|
+
export * from "./utils/objects/descriptorOf.js";
|
|
47
|
+
export * from "./utils/objects/getClassOrSymbol.js";
|
|
48
|
+
export * from "./utils/objects/getConstructorArgNames.js";
|
|
49
|
+
export * from "./utils/objects/getEnumerableKeys.js";
|
|
50
|
+
export * from "./utils/objects/getValue.js";
|
|
51
|
+
export * from "./utils/objects/isArray.js";
|
|
52
|
+
export * from "./utils/objects/isArrowFn.js";
|
|
53
|
+
export * from "./utils/objects/isBoolean.js";
|
|
54
|
+
export * from "./utils/objects/isBuffer.js";
|
|
55
|
+
export * from "./utils/objects/isClass.js";
|
|
56
|
+
export * from "./utils/objects/isCollection.js";
|
|
57
|
+
export * from "./utils/objects/isDate.js";
|
|
58
|
+
export * from "./utils/objects/isEmpty.js";
|
|
59
|
+
export * from "./utils/objects/isEnumerable.js";
|
|
60
|
+
export * from "./utils/objects/isFunction.js";
|
|
61
|
+
export * from "./utils/objects/isInheritedFrom.js";
|
|
62
|
+
export * from "./utils/objects/isNil.js";
|
|
63
|
+
export * from "./utils/objects/isNumber.js";
|
|
64
|
+
export * from "./utils/objects/isObject.js";
|
|
65
|
+
export * from "./utils/objects/isObservable.js";
|
|
66
|
+
export * from "./utils/objects/isPlainObject.js";
|
|
67
|
+
export * from "./utils/objects/isPrimitive.js";
|
|
68
|
+
export * from "./utils/objects/isPromise.js";
|
|
69
|
+
export * from "./utils/objects/isProtectedKey.js";
|
|
70
|
+
export * from "./utils/objects/isSerializable.js";
|
|
71
|
+
export * from "./utils/objects/isStream.js";
|
|
72
|
+
export * from "./utils/objects/isString.js";
|
|
73
|
+
export * from "./utils/objects/isSymbol.js";
|
|
74
|
+
export * from "./utils/objects/methodsOf.js";
|
|
75
|
+
export * from "./utils/objects/nameOf.js";
|
|
76
|
+
export * from "./utils/objects/objectKeys.js";
|
|
77
|
+
export * from "./utils/objects/primitiveOf.js";
|
|
78
|
+
export * from "./utils/objects/prototypeOf.js";
|
|
79
|
+
export * from "./utils/objects/setValue.js";
|
|
80
|
+
export * from "./utils/objects/toMap.js";
|
|
81
|
+
export * from "./utils/objects/toStringConstructor.js";
|
|
6
82
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,y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wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./decorators/configurable\";\nexport * from \"./decorators/deprecated\";\nexport * from \"./decorators/enumerable\";\nexport * from \"./decorators/notConfigurable\";\nexport * from \"./decorators/notEnumerable\";\nexport * from \"./decorators/readOnly\";\nexport * from \"./decorators/storeFn\";\nexport * from \"./decorators/storeMerge\";\nexport * from \"./decorators/storeSet\";\nexport * from \"./decorators/writable\";\nexport * from \"./domain/AnyToPromise\";\nexport * from \"./domain/DecoratorTypes\";\nexport * from \"./domain/Env\";\nexport * from \"./domain/Hooks\";\nexport * from \"./domain/Metadata\";\nexport * from \"./domain/Store\";\nexport * from \"./domain/Type\";\nexport * from \"./errors/UnsupportedDecoratorType\";\nexport * from \"./interfaces/AnyDecorator\";\nexport * from \"./interfaces/DecoratorParameters\";\nexport * from \"./interfaces/HashOf\";\nexport * from \"./interfaces/MetadataTypes\";\nexport * from \"./interfaces/ValueOf\";\nexport * from \"./utils/catchError\";\nexport * from \"./utils/proxyDelegation\";\nexport * from \"./utils/uniq\";\nexport * from \"./utils/decorators/decorateMethodsOf\";\nexport * from \"./utils/decorators/decoratorArgs\";\nexport * from \"./utils/decorators/decoratorTypeOf\";\nexport * from \"./utils/decorators/inheritedDescriptorOf\";\nexport * from \"./utils/decorators/useDecorators\";\nexport * from \"./utils/decorators/useMethodDecorators\";\nexport * from \"./utils/http/getHostInfoFromPort\";\nexport * from \"./utils/imports/importPackage\";\nexport * from \"./utils/objects/ancestorOf\";\nexport * from \"./utils/objects/ancestorsOf\";\nexport * from \"./utils/objects/classOf\";\nexport * from \"./utils/objects/cleanObject\";\nexport * from \"./utils/objects/constructorOf\";\nexport * from \"./utils/objects/createInstance\";\nexport * from \"./utils/objects/deepClone\";\nexport * from \"./utils/objects/deepMerge\";\nexport * from \"./utils/objects/descriptorOf\";\nexport * from \"./utils/objects/getClassOrSymbol\";\nexport * from \"./utils/objects/getConstructorArgNames\";\nexport * from \"./utils/objects/getEnumerableKeys\";\nexport * from \"./utils/objects/getValue\";\nexport * from \"./utils/objects/isArray\";\nexport * from \"./utils/objects/isArrowFn\";\nexport * from \"./utils/objects/isBoolean\";\nexport * from \"./utils/objects/isBuffer\";\nexport * from \"./utils/objects/isClass\";\nexport * from \"./utils/objects/isCollection\";\nexport * from \"./utils/objects/isDate\";\nexport * from \"./utils/objects/isEmpty\";\nexport * from \"./utils/objects/isEnumerable\";\nexport * from \"./utils/objects/isFunction\";\nexport * from \"./utils/objects/isInheritedFrom\";\nexport * from \"./utils/objects/isNil\";\nexport * from \"./utils/objects/isNumber\";\nexport * from \"./utils/objects/isObject\";\nexport * from \"./utils/objects/isObservable\";\nexport * from \"./utils/objects/isPlainObject\";\nexport * from \"./utils/objects/isPrimitive\";\nexport * from \"./utils/objects/isPromise\";\nexport * from \"./utils/objects/isProtectedKey\";\nexport * from \"./utils/objects/isSerializable\";\nexport * from \"./utils/objects/isStream\";\nexport * from \"./utils/objects/isString\";\nexport * from \"./utils/objects/isSymbol\";\nexport * from \"./utils/objects/methodsOf\";\nexport * from \"./utils/objects/nameOf\";\nexport * from \"./utils/objects/objectKeys\";\nexport * from \"./utils/objects/primitiveOf\";\nexport * from \"./utils/objects/prototypeOf\";\nexport * from \"./utils/objects/setValue\";\nexport * from \"./utils/objects/toMap\";\nexport * from \"./utils/objects/toStringConstructor\";\n"]}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Store } from "../../domain/Store.js";
|
|
2
|
+
import { classOf } from "../objects/classOf.js";
|
|
3
|
+
import { descriptorOf } from "../objects/descriptorOf.js";
|
|
4
|
+
import { methodsOf } from "../objects/methodsOf.js";
|
|
5
|
+
import { prototypeOf } from "../objects/prototypeOf.js";
|
|
6
6
|
export function decorateMethodsOf(klass, decorator) {
|
|
7
7
|
methodsOf(klass).forEach(({ target, propertyKey }) => {
|
|
8
|
+
const proto = prototypeOf(klass);
|
|
8
9
|
if (target !== classOf(klass)) {
|
|
9
|
-
Object.defineProperty(
|
|
10
|
+
Object.defineProperty(proto, propertyKey, {
|
|
11
|
+
writable: true,
|
|
12
|
+
configurable: true,
|
|
10
13
|
value(...args) {
|
|
11
14
|
return prototypeOf(target)[propertyKey].apply(this, args);
|
|
12
15
|
}
|
|
13
16
|
});
|
|
14
17
|
Store.mergeStoreMethodFrom(klass, target, propertyKey);
|
|
15
18
|
}
|
|
16
|
-
decorator(
|
|
19
|
+
const newDescriptor = decorator(proto, propertyKey, descriptorOf(klass, propertyKey));
|
|
20
|
+
if (newDescriptor) {
|
|
21
|
+
Object.defineProperty(proto, propertyKey, newDescriptor);
|
|
22
|
+
}
|
|
17
23
|
});
|
|
18
24
|
}
|
|
19
25
|
//# sourceMappingURL=decorateMethodsOf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,iBAAiB,CAAC,KAAU,EAAE,SAAc;IAC1D,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE;gBACxC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,KAAK,CAAC,GAAG,IAAW;oBAClB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5D,CAAC;aACF,CAAC,CAAC;YAEH,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SACxD;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;QAEtF,IAAI,aAAa,EAAE;YACjB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../../domain/Store\";\nimport {classOf} from \"../objects/classOf\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\nimport {methodsOf} from \"../objects/methodsOf\";\nimport {prototypeOf} from \"../objects/prototypeOf\";\n\nexport function decorateMethodsOf(klass: any, decorator: any) {\n methodsOf(klass).forEach(({target, propertyKey}) => {\n const proto = prototypeOf(klass);\n\n if (target !== classOf(klass)) {\n Object.defineProperty(proto, propertyKey, {\n writable: true,\n configurable: true,\n value(...args: any[]) {\n return prototypeOf(target)[propertyKey].apply(this, args);\n }\n });\n\n Store.mergeStoreMethodFrom(klass, target, propertyKey);\n }\n\n const newDescriptor = decorator(proto, propertyKey, descriptorOf(klass, propertyKey));\n\n if (newDescriptor) {\n Object.defineProperty(proto, propertyKey, newDescriptor);\n }\n });\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DecoratorTypes } from "../../domain/DecoratorTypes";
|
|
2
|
-
import { classOf } from "../objects/classOf";
|
|
1
|
+
import { DecoratorTypes } from "../../domain/DecoratorTypes.js";
|
|
2
|
+
import { classOf } from "../objects/classOf.js";
|
|
3
3
|
export function decoratorTypeOf(args) {
|
|
4
4
|
const [target, propertyKey, descriptor] = args;
|
|
5
5
|
const staticType = (type) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ancestorsOf } from "../objects/ancestorsOf";
|
|
1
|
+
import { ancestorsOf } from "../objects/ancestorsOf.js";
|
|
2
2
|
export function inheritedDescriptorOf(target, propertyKey) {
|
|
3
3
|
for (const klass of ancestorsOf(target)) {
|
|
4
4
|
const descriptor = Object.getOwnPropertyDescriptor((klass && klass.prototype) || klass, propertyKey);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { classOf } from "./classOf";
|
|
2
|
-
import { getInheritedClass } from "./ancestorOf";
|
|
3
|
-
import { nameOf } from "./nameOf";
|
|
1
|
+
import { classOf } from "./classOf.js";
|
|
2
|
+
import { getInheritedClass } from "./ancestorOf.js";
|
|
3
|
+
import { nameOf } from "./nameOf.js";
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param target
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { isArray } from "./isArray";
|
|
2
|
-
import { isDate } from "./isDate";
|
|
3
|
-
import { isFunction } from "./isFunction";
|
|
4
|
-
import { isNil } from "./isNil";
|
|
5
|
-
import { isPrimitive } from "./isPrimitive";
|
|
6
|
-
import { isSymbol } from "./isSymbol";
|
|
1
|
+
import { isArray } from "./isArray.js";
|
|
2
|
+
import { isDate } from "./isDate.js";
|
|
3
|
+
import { isFunction } from "./isFunction.js";
|
|
4
|
+
import { isNil } from "./isNil.js";
|
|
5
|
+
import { isPrimitive } from "./isPrimitive.js";
|
|
6
|
+
import { isSymbol } from "./isSymbol.js";
|
|
7
|
+
import { isBuffer } from "./isBuffer.js";
|
|
7
8
|
const isBasicType = (source) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source);
|
|
8
9
|
/**
|
|
9
10
|
* Return a cloned value
|
|
@@ -15,6 +16,11 @@ export function deepClone(source, stack = new WeakMap()) {
|
|
|
15
16
|
if (isBasicType(source)) {
|
|
16
17
|
return source;
|
|
17
18
|
}
|
|
19
|
+
if (isBuffer(source)) {
|
|
20
|
+
const copy = Buffer.alloc(source.length);
|
|
21
|
+
source.copy(copy);
|
|
22
|
+
return copy;
|
|
23
|
+
}
|
|
18
24
|
if (isDate(source)) {
|
|
19
25
|
return new Date(source);
|
|
20
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepClone.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepClone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,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AI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACjC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAChD;iBAAM;gBACL,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;aAC9C;SACF;KACF;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACpB,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KACzC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isArray} from \"./isArray\";\nimport {isDate} from \"./isDate\";\nimport {isFunction} from \"./isFunction\";\nimport {isNil} from \"./isNil\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {isSymbol} from \"./isSymbol\";\n\nconst isBasicType = (source: any) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source);\n\n/**\n * Return a cloned value\n * @param source\n * @param stack\n */\nexport function deepClone(source: any, stack = new WeakMap()): any {\n let dest: any;\n\n if (isBasicType(source)) {\n return source;\n }\n\n if (isDate(source)) {\n return new Date(source);\n }\n\n const stacked = stack.get(source);\n\n if (stacked) {\n // See issue #1619\n // istanbul ignore next\n process.env.TSED_TRACK_CIRCULAR_REF && console.trace(\"Circular ref detected on deepClone\", stacked);\n return stacked;\n }\n\n if (isArray(source)) {\n dest = [];\n } else {\n dest = {};\n stack.set(source, dest);\n }\n\n for (const key in source) {\n // Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter.\n const descriptor = Object.getOwnPropertyDescriptor(source, key)!;\n\n if (descriptor) {\n if (!isFunction(descriptor.value)) {\n dest[key] = deepClone(descriptor.value, stack);\n } else {\n Object.defineProperty(dest, key, descriptor);\n }\n }\n }\n\n if (!isArray(source)) {\n const prototype = Reflect.getPrototypeOf(source);\n Reflect.setPrototypeOf(dest, prototype);\n }\n\n return dest;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deepClone.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepClone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAW,EAAE,KAAK,GAAG,IAAI,OAAO,EAAE;IAC1D,IAAI,IAAS,CAAC;IAEd,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;QACpB,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;QAClB,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;KACzB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAElC,IAAI,OAAO,EAAE;QACX,kBAAkB;QAClB,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;QACpG,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;QACnB,IAAI,GAAG,EAAE,CAAC;KACX;SAAM;QACL,IAAI,GAAG,EAAE,CAAC;QACV,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KACzB;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,gGAAgG;QAChG,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAE,CAAC;QAEjE,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACjC,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAChD;iBAAM;gBACL,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;aAC9C;SACF;KACF;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACpB,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KACzC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isArray} from \"./isArray\";\nimport {isDate} from \"./isDate\";\nimport {isFunction} from \"./isFunction\";\nimport {isNil} from \"./isNil\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {isSymbol} from \"./isSymbol\";\nimport {isBuffer} from \"./isBuffer\";\n\nconst isBasicType = (source: any) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source);\n\n/**\n * Return a cloned value\n * @param source\n * @param stack\n */\nexport function deepClone(source: any, stack = new WeakMap()): any {\n let dest: any;\n\n if (isBasicType(source)) {\n return source;\n }\n\n if (isBuffer(source)) {\n const copy = Buffer.alloc(source.length);\n source.copy(copy);\n return copy;\n }\n\n if (isDate(source)) {\n return new Date(source);\n }\n\n const stacked = stack.get(source);\n\n if (stacked) {\n // See issue #1619\n // istanbul ignore next\n process.env.TSED_TRACK_CIRCULAR_REF && console.trace(\"Circular ref detected on deepClone\", stacked);\n return stacked;\n }\n\n if (isArray(source)) {\n dest = [];\n } else {\n dest = {};\n stack.set(source, dest);\n }\n\n for (const key in source) {\n // Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter.\n const descriptor = Object.getOwnPropertyDescriptor(source, key)!;\n\n if (descriptor) {\n if (!isFunction(descriptor.value)) {\n dest[key] = deepClone(descriptor.value, stack);\n } else {\n Object.defineProperty(dest, key, descriptor);\n }\n }\n }\n\n if (!isArray(source)) {\n const prototype = Reflect.getPrototypeOf(source);\n Reflect.setPrototypeOf(dest, prototype);\n }\n\n return dest;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createInstance } from "./createInstance";
|
|
2
|
-
import { isFunction } from "./isFunction";
|
|
3
|
-
import { isPrimitive } from "./isPrimitive";
|
|
4
|
-
import { isSymbol } from "./isSymbol";
|
|
5
|
-
import { objectKeys } from "./objectKeys";
|
|
1
|
+
import { createInstance } from "./createInstance.js";
|
|
2
|
+
import { isFunction } from "./isFunction.js";
|
|
3
|
+
import { isPrimitive } from "./isPrimitive.js";
|
|
4
|
+
import { isSymbol } from "./isSymbol.js";
|
|
5
|
+
import { objectKeys } from "./objectKeys.js";
|
|
6
6
|
export function mergeReducerBuilder(cb) {
|
|
7
7
|
return (collection, value, options) => {
|
|
8
8
|
const index = collection.findIndex((item) => cb(item, value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepMer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ED,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;QAClF,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;YAC5C,GAAG,OAAO;YACV,SAAS,EAAE,GAAG;SACf,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,mBAAmB,IAAI,KAAK,KAAK,SAAS,EAAE;YACtD,OAAO,GAAG,CAAC;SACZ;QAED,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {createInstance} from \"./createInstance\";\nimport {isFunction} from \"./isFunction\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {isSymbol} from \"./isSymbol\";\nimport {objectKeys} from \"./objectKeys\";\n\nexport type DeepMergeReducerCB = (collection: any[], value: any, options?: DeepMergeOptions) => any;\nexport type DeepMergeComparatorCB = (item: any, ref: any) => boolean;\n\nexport interface DeepMergeOptions {\n reducers?: Record<string, DeepMergeReducerCB>;\n parentKey?: string;\n cleanUndefinedProps?: boolean;\n}\n\nexport function mergeReducerBuilder(cb: DeepMergeComparatorCB) {\n return (collection: any[], value: any, options: DeepMergeOptions) => {\n const index = collection.findIndex((item) => cb(item, value));\n\n if (index === -1) {\n return [...collection, value];\n }\n\n collection[index] = deepMerge(collection[index], value, options);\n\n return collection;\n };\n}\n\nconst defaultReducer = mergeReducerBuilder((a, b) => a === b);\n\nfunction getReducer({reducers, parentKey}: DeepMergeOptions) {\n if (!reducers) {\n return defaultReducer;\n }\n\n if (parentKey && reducers[parentKey]) {\n return reducers[parentKey];\n }\n\n return reducers[\"default\"] || defaultReducer;\n}\n\nfunction shouldReturnObj(obj: any, source: any) {\n return isPrimitive(obj) || isSymbol(obj) || isFunction(obj) || source === undefined;\n}\n\nfunction shouldReturnSource(obj: any, source: any) {\n return obj === undefined || obj === null || (obj === \"\" && source !== \"\");\n}\n\nexport function deepMerge<T = any, C = any>(source: T & any, obj: C & any, options: DeepMergeOptions = {}): (T & C) | undefined | null {\n if (shouldReturnSource(obj, source)) {\n return source as any;\n }\n\n if (shouldReturnObj(obj, source)) {\n return obj;\n }\n\n if (Array.isArray(source)) {\n const reducer = getReducer(options);\n\n return [].concat(obj).reduce((out: any[], value: any) => reducer(out, value, options), [...source]);\n }\n\n return [...objectKeys(source), ...objectKeys(obj)].reduce((out: any, key: string) => {\n const src = source && source[key];\n const value = deepMerge(src, obj && obj[key], {\n ...options,\n parentKey: key\n });\n\n if (options.cleanUndefinedProps && value === undefined) {\n return out;\n }\n\n return {\n ...out,\n [key]: value\n };\n }, createInstance(source));\n}\n"]}
|
|
@@ -8,7 +8,6 @@ export function descriptorOf(target, propertyKey) {
|
|
|
8
8
|
return Object.getOwnPropertyDescriptor((target && target.prototype) || target, propertyKey);
|
|
9
9
|
}
|
|
10
10
|
export function isMethodDescriptor(target, propertyKey) {
|
|
11
|
-
|
|
12
|
-
return (_a = descriptorOf(target, propertyKey)) === null || _a === void 0 ? void 0 : _a.value;
|
|
11
|
+
return descriptorOf(target, propertyKey)?.value;
|
|
13
12
|
}
|
|
14
13
|
//# sourceMappingURL=descriptorOf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/descriptorOf.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAW,EAAE,WAA4B;IACpE,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,CAAE,CAAC;AAC/F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,WAA4B
|
|
1
|
+
{"version":3,"file":"descriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/descriptorOf.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAW,EAAE,WAA4B;IACpE,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,CAAE,CAAC;AAC/F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,WAA4B;IAC1E,OAAO,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Return the descriptor for a given class and propertyKey\n * @param target\n * @param {string} propertyKey\n * @returns {PropertyDescriptor}\n */\nexport function descriptorOf(target: any, propertyKey: string | symbol): PropertyDescriptor {\n return Object.getOwnPropertyDescriptor((target && target.prototype) || target, propertyKey)!;\n}\n\nexport function isMethodDescriptor(target: any, propertyKey: string | symbol) {\n return descriptorOf(target, propertyKey)?.value;\n}\n"]}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { toStringConstructor } from "./toStringConstructor";
|
|
1
|
+
import { toStringConstructor } from "./toStringConstructor.js";
|
|
2
2
|
export function getConstructorArgNames(target) {
|
|
3
|
-
return toStringConstructor(target)
|
|
3
|
+
return toStringConstructor(target)
|
|
4
|
+
.split("constructor(")[1]
|
|
5
|
+
.split(")")[0]
|
|
6
|
+
.split(", ")
|
|
7
|
+
.filter(Boolean)
|
|
8
|
+
.map((s) => s.trim());
|
|
4
9
|
}
|
|
5
10
|
//# sourceMappingURL=getConstructorArgNames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,sBAAsB,CAAC,MAAW;IAChD,OAAO,mBAAmB,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,sBAAsB,CAAC,MAAW;IAChD,OAAO,mBAAmB,CAAC,MAAM,CAAC;SAC/B,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SACxB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACb,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import {toStringConstructor} from \"./toStringConstructor\";\n\nexport function getConstructorArgNames(target: any) {\n return toStringConstructor(target)\n .split(\"constructor(\")[1]\n .split(\")\")[0]\n .split(\", \")\n .filter(Boolean)\n .map((s) => s.trim());\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isEnumerable } from "./isEnumerable";
|
|
2
|
-
import { isProtectedKey } from "./isProtectedKey";
|
|
1
|
+
import { isEnumerable } from "./isEnumerable.js";
|
|
2
|
+
import { isProtectedKey } from "./isProtectedKey.js";
|
|
3
3
|
/**
|
|
4
4
|
* Return all enumerable keys of the given object
|
|
5
5
|
* @param obj
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isFunction } from "./isFunction";
|
|
2
|
-
import { isObject } from "./isObject";
|
|
3
|
-
import { isString } from "./isString";
|
|
1
|
+
import { isFunction } from "./isFunction.js";
|
|
2
|
+
import { isObject } from "./isObject.js";
|
|
3
|
+
import { isString } from "./isString.js";
|
|
4
4
|
const mapOptions = (args) => {
|
|
5
5
|
const [expression, scope, defaultValue, separator = "."] = args;
|
|
6
6
|
if (isObject(scope) || isString(expression)) {
|
|
@@ -31,7 +31,7 @@ export function getValue(...args) {
|
|
|
31
31
|
const keys = expression.split(separator);
|
|
32
32
|
const getValue = (key) => {
|
|
33
33
|
if (scope) {
|
|
34
|
-
if (scope[key] !== undefined || key in scope) {
|
|
34
|
+
if (scope[key] !== undefined || (isObject(scope) && key in scope)) {
|
|
35
35
|
return scope[key];
|
|
36
36
|
}
|
|
37
37
|
if (isFunction(scope.get)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/getValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,GAAG,CAAC,IAAW,EAAE,EAAE;IACjC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IAEhE,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC3C,OAAO;YACL,UAAU;YACV,KAAK;YACL,YAAY;YACZ,SAAS;SACV,CAAC;KACH;IAED,OAAO;QACL,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;QACjB,YAAY;QACZ,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAkCF,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAW;IACrC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC1B,MAAM,EAAC,UAAU,EAAE,YAAY,EAAE,SAA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CAAC,UAAU,EAAE;QACf,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,YAAY,CAAC;KACrB;IAED,MAAM,IAAI,GAAa,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;QAC/B,IAAI,KAAK,EAAE;YACT,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,KAAK,CAAC,EAAE;gBACjE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YAED,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBACzB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACvB;SACF;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAG,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,GAAE;IAE3D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC","sourcesContent":["import {isFunction} from \"./isFunction\";\nimport {isObject} from \"./isObject\";\nimport {isString} from \"./isString\";\n\nconst mapOptions = (args: any[]) => {\n const [expression, scope, defaultValue, separator = \".\"] = args;\n\n if (isObject(scope) || isString(expression)) {\n return {\n expression,\n scope,\n defaultValue,\n separator\n };\n }\n\n return {\n expression: scope,\n scope: expression,\n defaultValue,\n separator\n };\n};\n\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @returns {any}\n */\nexport function getValue<T = any>(scope: any, expression: string | undefined): T | undefined;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @param defaultValue\n * @param separator\n * @returns {any}\n */\nexport function getValue<T = any>(scope: any, expression: string | undefined, defaultValue: T, separator?: string): T;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @returns {any}\n */\nexport function getValue<T = any>(expression: string | undefined, scope: any): T | undefined;\n/**\n * Get value from scope\n * @param {string} expression\n * @param scope\n * @param defaultValue\n * @param separator\n * @returns {any}\n */\nexport function getValue<T = any>(expression: string | undefined, scope: any, defaultValue: T, separator?: string): T;\nexport function getValue(...args: any[]) {\n const options = mapOptions(args);\n let scope = options.scope;\n const {expression, defaultValue, separator} = options;\n\n if (!expression) {\n return scope;\n }\n\n if (!scope) {\n return defaultValue;\n }\n\n const keys: string[] = expression.split(separator);\n\n const getValue = (key: string) => {\n if (scope) {\n if (scope[key] !== undefined || (isObject(scope) && key in scope)) {\n return scope[key];\n }\n\n if (isFunction(scope.get)) {\n return scope.get(key);\n }\n }\n };\n\n while ((scope = getValue(keys.shift()!)) && keys.length) {}\n\n return scope === undefined ? defaultValue : scope;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBuffer.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBuffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAW;IAClC,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,YAAY,MAAM,CAAC;AACvD,CAAC","sourcesContent":["/**\n * Tests to see if the object is Buffer\n * @param target\n * @returns {boolean}\n */\nexport function isBuffer(target: any): target is Buffer {\n return target === Buffer || target instanceof Buffer;\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { isArrayOrArrayClass } from "./isArray";
|
|
2
|
-
import { isArrowFn } from "./isArrowFn";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { isArrayOrArrayClass } from "./isArray.js";
|
|
2
|
+
import { isArrowFn } from "./isArrowFn.js";
|
|
3
|
+
import { isBuffer } from "./isBuffer.js";
|
|
4
|
+
import { isDate } from "./isDate.js";
|
|
5
|
+
import { isClassObject } from "./isPlainObject.js";
|
|
6
|
+
import { isPrimitiveOrPrimitiveClass } from "./isPrimitive.js";
|
|
7
|
+
import { isPromise } from "./isPromise.js";
|
|
8
|
+
import { isSymbol } from "./isSymbol.js";
|
|
8
9
|
export function isClass(target) {
|
|
9
10
|
if (!target) {
|
|
10
11
|
return false;
|
|
@@ -17,6 +18,7 @@ export function isClass(target) {
|
|
|
17
18
|
isClassObject(target) ||
|
|
18
19
|
isDate(target) ||
|
|
19
20
|
isPromise(target) ||
|
|
20
|
-
isArrayOrArrayClass(target)
|
|
21
|
+
isArrayOrArrayClass(target) ||
|
|
22
|
+
isBuffer(target));
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=isClass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isClass.js","sourceRoot":"","sources":["../../../../src/utils/objects/isClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,OAAO,CAAC,MAAW;IACjC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,KAAK,CAAC;KACd;IAED,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CAAC,CACN,QAAQ,CAAC,MAAM,CAAC;QAChB,2BAA2B,CAAC,MAAM,CAAC;QACnC,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC;QACd,SAAS,CAAC,MAAM,CAAC;QACjB,mBAAmB,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"isClass.js","sourceRoot":"","sources":["../../../../src/utils/objects/isClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,OAAO,CAAC,MAAW;IACjC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,KAAK,CAAC;KACd;IAED,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CAAC,CACN,QAAQ,CAAC,MAAM,CAAC;QAChB,2BAA2B,CAAC,MAAM,CAAC;QACnC,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC;QACd,SAAS,CAAC,MAAM,CAAC;QACjB,mBAAmB,CAAC,MAAM,CAAC;QAC3B,QAAQ,CAAC,MAAM,CAAC,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {isArrayOrArrayClass} from \"./isArray\";\nimport {isArrowFn} from \"./isArrowFn\";\nimport {isBuffer} from \"./isBuffer\";\nimport {isDate} from \"./isDate\";\nimport {isClassObject} from \"./isPlainObject\";\nimport {isPrimitiveOrPrimitiveClass} from \"./isPrimitive\";\nimport {isPromise} from \"./isPromise\";\nimport {isSymbol} from \"./isSymbol\";\n\nexport function isClass(target: any) {\n if (!target) {\n return false;\n }\n\n if (isArrowFn(target)) {\n return false;\n }\n\n return !(\n isSymbol(target) ||\n isPrimitiveOrPrimitiveClass(target) ||\n isClassObject(target) ||\n isDate(target) ||\n isPromise(target) ||\n isArrayOrArrayClass(target) ||\n isBuffer(target)\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { classOf } from "./classOf";
|
|
2
|
-
import { ancestorOf } from "./ancestorOf";
|
|
3
|
-
import { nameOf } from "./nameOf";
|
|
1
|
+
import { classOf } from "./classOf.js";
|
|
2
|
+
import { ancestorOf } from "./ancestorOf.js";
|
|
3
|
+
import { nameOf } from "./nameOf.js";
|
|
4
4
|
export function isInheritedFrom(target, from, deep = 5) {
|
|
5
5
|
if (!target || !from) {
|
|
6
6
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isBoolean, isBooleanOrBooleanClass } from "./isBoolean";
|
|
2
|
-
import { isNumber, isNumberOrNumberClass } from "./isNumber";
|
|
3
|
-
import { isString, isStringOrStringClass } from "./isString";
|
|
1
|
+
import { isBoolean, isBooleanOrBooleanClass } from "./isBoolean.js";
|
|
2
|
+
import { isNumber, isNumberOrNumberClass } from "./isNumber.js";
|
|
3
|
+
import { isString, isStringOrStringClass } from "./isString.js";
|
|
4
4
|
/**
|
|
5
5
|
* Return true if the given obj is a primitive.
|
|
6
6
|
* @param target
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isStream } from "./isStream";
|
|
2
|
-
import { isBoolean } from "./isBoolean";
|
|
3
|
-
import { isNumber } from "./isNumber";
|
|
4
|
-
import { isString } from "./isString";
|
|
5
|
-
import { isNil } from "./isNil";
|
|
1
|
+
import { isStream } from "./isStream.js";
|
|
2
|
+
import { isBoolean } from "./isBoolean.js";
|
|
3
|
+
import { isNumber } from "./isNumber.js";
|
|
4
|
+
import { isString } from "./isString.js";
|
|
5
|
+
import { isNil } from "./isNil.js";
|
|
6
6
|
export function isSerializable(data) {
|
|
7
7
|
return !(Buffer.isBuffer(data) || isStream(data) || isBoolean(data) || isNumber(data) || isString(data) || isNil(data));
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { classOf } from "./classOf";
|
|
2
|
-
import { ancestorsOf } from "./ancestorsOf";
|
|
3
|
-
import { prototypeOf } from "./prototypeOf";
|
|
1
|
+
import { classOf } from "./classOf.js";
|
|
2
|
+
import { ancestorsOf } from "./ancestorsOf.js";
|
|
3
|
+
import { prototypeOf } from "./prototypeOf.js";
|
|
4
4
|
/**
|
|
5
5
|
* Return all methods for a given class.
|
|
6
6
|
* @param target
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAW;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,CAAC,WAAmB,EAAE,EAAE;YACnC,IAAI,WAAW,KAAK,aAAa,EAAE;gBACjC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC;aACjD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {ancestorsOf} from \"./ancestorsOf\";\nimport {prototypeOf} from \"./prototypeOf\";\nimport {Type} from \"../../domain/Type\";\n\n/**\n * Return all methods for a given class.\n * @param target\n */\nexport function methodsOf(target: any): {target: Type; propertyKey: string}[] {\n const methods = new Map();\n target = classOf(target);\n\n ancestorsOf(target).forEach((target) => {\n const keys = Reflect.ownKeys(prototypeOf(target));\n\n keys.forEach((propertyKey: string) => {\n if (propertyKey !== \"constructor\") {\n methods.set(propertyKey, {target, propertyKey});\n }\n });\n });\n\n return Array.from(methods.values());\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isBooleanOrBooleanClass } from "./isBoolean";
|
|
2
|
-
import { isNumberOrNumberClass } from "./isNumber";
|
|
3
|
-
import { isStringOrStringClass } from "./isString";
|
|
1
|
+
import { isBooleanOrBooleanClass } from "./isBoolean.js";
|
|
2
|
+
import { isNumberOrNumberClass } from "./isNumber.js";
|
|
3
|
+
import { isStringOrStringClass } from "./isString.js";
|
|
4
4
|
export function primitiveOf(target) {
|
|
5
5
|
if (isStringOrStringClass(target)) {
|
|
6
6
|
return "string";
|