@tsed/core 6.107.5 → 6.110.0

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.
@@ -35,17 +35,17 @@ class AnyToPromise {
35
35
  _AnyToPromise_rejects.set(this, void 0);
36
36
  _AnyToPromise_hasNextFunction.set(this, false);
37
37
  _AnyToPromise_promise.set(this, void 0);
38
- (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_hasNextFunction, hasNextFunction, "f");
39
- (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_promise, new Promise((resolve, reject) => {
40
- (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_resolves, resolve, "f");
41
- (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_rejects, reject, "f");
38
+ tslib_1.__classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, hasNextFunction, "f");
39
+ tslib_1.__classPrivateFieldSet(this, _AnyToPromise_promise, new Promise((resolve, reject) => {
40
+ tslib_1.__classPrivateFieldSet(this, _AnyToPromise_resolves, resolve, "f");
41
+ tslib_1.__classPrivateFieldSet(this, _AnyToPromise_rejects, reject, "f");
42
42
  }), "f");
43
43
  }
44
44
  isDone() {
45
45
  return this.status !== AnyToPromiseStatus.PENDING;
46
46
  }
47
47
  get next() {
48
- (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_hasNextFunction, true, "f");
48
+ tslib_1.__classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, true, "f");
49
49
  return (error) => {
50
50
  if (this.isDone()) {
51
51
  return;
@@ -66,21 +66,21 @@ class AnyToPromise {
66
66
  catch (er) {
67
67
  this.reject(er);
68
68
  }
69
- return (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_promise, "f");
69
+ return tslib_1.__classPrivateFieldGet(this, _AnyToPromise_promise, "f");
70
70
  }
71
71
  reject(er) {
72
72
  if (this.isDone()) {
73
73
  return;
74
74
  }
75
75
  this.done(AnyToPromiseStatus.REJECTED);
76
- (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_rejects, "f").call(this, er);
76
+ tslib_1.__classPrivateFieldGet(this, _AnyToPromise_rejects, "f").call(this, er);
77
77
  }
78
78
  resolve(response = {}) {
79
79
  if (this.isDone()) {
80
80
  return;
81
81
  }
82
82
  this.done(AnyToPromiseStatus.RESOLVED);
83
- (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_resolves, "f").call(this, { ...response, state: AnyToPromiseStatus.RESOLVED });
83
+ tslib_1.__classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { ...response, state: AnyToPromiseStatus.RESOLVED });
84
84
  }
85
85
  destroy() { }
86
86
  cancel() {
@@ -88,7 +88,7 @@ class AnyToPromise {
88
88
  return;
89
89
  }
90
90
  this.done(AnyToPromiseStatus.CANCELED);
91
- return (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_resolves, "f").call(this, { state: AnyToPromiseStatus.CANCELED });
91
+ return tslib_1.__classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { state: AnyToPromiseStatus.CANCELED });
92
92
  }
93
93
  done(status) {
94
94
  this.destroy();
@@ -130,7 +130,7 @@ class AnyToPromise {
130
130
  });
131
131
  }
132
132
  }
133
- if (!(0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_hasNextFunction, "f")) {
133
+ if (!tslib_1.__classPrivateFieldGet(this, _AnyToPromise_hasNextFunction, "f")) {
134
134
  // no next function and empty response
135
135
  return this.resolve({
136
136
  ...additionalProps,
@@ -1 +1 @@
1
- {"version":3,"file":"AnyToPromise.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromise.ts"],"names":[],"mappings":";;;;;AAAA,gEAA2D;AAC3D,0DAAqD;AACrD,wDAAmD;AAEnD;;GAEG;AACH,SAAS,UAAU,CAAC,GAAQ;IAC1B,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAA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B,IAAI,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;qBACpC;oBACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACN;SACF;QAED,IAAI,CAAC,oCAAA,IAAI,qCAAiB,EAAE;YAC1B,sCAAsC;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,GAAG,eAAe;gBAClB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,yBAAyB,CAAC,IAAI;aACrC,CAAC,CAAC;SACJ;IACH,CAAC;IAES,kBAAkB,CAAC,OAAY;QACvC,OAAO,OAAO,KAAK,kBAAkB,CAAC,QAAQ,CAAC;IACjD,CAAC;CACF;AAhJD,oCAgJC","sourcesContent":["import {isObservable} from \"../utils/objects/isObservable\";\nimport {isPromise} from \"../utils/objects/isPromise\";\nimport {isStream} from \"../utils/objects/isStream\";\n\n/**\n * @ignore\n */\nfunction isResponse(obj: any) {\n return obj.data && obj.headers && obj.status && obj.statusText;\n}\n\n/**\n * @ignore\n */\nexport enum AnyToPromiseStatus {\n PENDING = \"PENDING\",\n CANCELED = \"CANCELED\",\n RESOLVED = \"RESOLVED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AnyToPromiseResponseTypes {\n STREAM = \"STREAM\",\n BUFFER = \"BUFFER\",\n DATA = \"DATA\"\n}\n\nexport interface AnyPromiseResult<T = any> {\n state: AnyToPromiseStatus;\n type: AnyToPromiseResponseTypes;\n status?: number;\n headers?: Record<string, any>;\n data: T;\n}\n\nexport class AnyToPromise<T = any> {\n public status = AnyToPromiseStatus.PENDING;\n public args: any[];\n\n #resolves: any;\n #rejects: any;\n #hasNextFunction = false;\n\n readonly #promise: Promise<AnyPromiseResult<T>>;\n\n constructor({hasNextFunction = false}: {hasNextFunction?: boolean} = {}) {\n this.#hasNextFunction = hasNextFunction;\n\n this.#promise = new Promise((resolve: any, reject: any) => {\n this.#resolves = resolve;\n this.#rejects = reject;\n });\n }\n\n isDone(): boolean {\n return this.status !== AnyToPromiseStatus.PENDING;\n }\n\n get next() {\n this.#hasNextFunction = true;\n\n return (error?: any) => {\n if (this.isDone()) {\n return;\n }\n\n return error ? this.reject(error) : this.resolve({type: AnyToPromiseResponseTypes.DATA});\n };\n }\n\n /**\n *\n */\n async call(cb: Function): Promise<AnyPromiseResult<T>> {\n if (this.isDone()) {\n return this as any;\n }\n\n try {\n this.handle(cb());\n } catch (er) {\n this.reject(er);\n }\n\n return this.#promise;\n }\n\n reject(er: any) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.REJECTED);\n\n this.#rejects(er);\n }\n\n resolve(response: any = {}) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.RESOLVED);\n\n this.#resolves({...response, state: AnyToPromiseStatus.RESOLVED});\n }\n\n destroy() {}\n\n cancel() {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.CANCELED);\n\n return this.#resolves({state: AnyToPromiseStatus.CANCELED});\n }\n\n done(status: AnyToPromiseStatus) {\n this.destroy();\n this.status = status;\n }\n\n handle(process: any, additionalProps = {}): any {\n if (this.isDone()) {\n return;\n }\n\n if (process) {\n if (this.isCanceledResponse(process)) {\n // ABANDON\n return this.cancel();\n }\n\n if (isObservable(process)) {\n process = process.toPromise();\n }\n\n if (isResponse(process)) {\n return this.handle(process.data, {\n ...additionalProps,\n status: process.status,\n headers: process.headers\n });\n }\n\n if (isStream(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process});\n }\n if (isStream(process) || Buffer.isBuffer(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process});\n }\n\n if (isPromise(process)) {\n return process\n .then((result: any) => this.handle(result, additionalProps))\n .catch((error: any) => {\n if (error.response && isResponse(error.response)) {\n return this.handle(error.response);\n }\n return this.reject(error);\n });\n }\n }\n\n if (!this.#hasNextFunction) {\n // no next function and empty response\n return this.resolve({\n ...additionalProps,\n data: process,\n type: AnyToPromiseResponseTypes.DATA\n });\n }\n }\n\n protected isCanceledResponse(process: any) {\n return process === AnyToPromiseStatus.CANCELED;\n }\n}\n"]}
1
+ {"version":3,"file":"AnyToPromise.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromise.ts"],"names":[],"mappings":";;;;;AAAA,gEAA2D;AAC3D,0DAAqD;AACrD,wDAAmD;AAEnD;;GAEG;AACH,SAAS,UAAU,CAAC,GAAQ;IAC1B,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;AACvB,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AAED,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACf,CAAC,EAJW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAIpC;AAUD,MAAa,YAAY;IAUvB,YAAY,EAAC,eAAe,GAAG,KAAK,KAAiC,EAAE;QAThE,WAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC;QAG3C,yCAAe;QACf,wCAAc;QACd,wCAAmB,KAAK,EAAC;QAEzB,wCAAgD;QAG9C,+BAAA,IAAI,iCAAoB,eAAe,MAAA,CAAC;QAExC,+BAAA,IAAI,yBAAY,IAAI,OAAO,CAAC,CAAC,OAAY,EAAE,MAAW,EAAE,EAAE;YACxD,+BAAA,IAAI,0BAAa,OAAO,MAAA,CAAC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EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;aAClG;YACD,IAAI,IAAA,mBAAQ,EAAC,OAAO,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBACjD,OAAO,IAAI,CAAC,OAAO,CAAC,EAAC,GAAG,eAAe,EAAE,IAAI,EAAE,yBAAyB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;aAClG;YAED,IAAI,IAAA,qBAAS,EAAC,OAAO,CAAC,EAAE;gBACtB,OAAO,OAAO;qBACX,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;qBAC3D,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;oBACpB,IAAI,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;qBACpC;oBACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACN;SACF;QAED,IAAI,CAAC,+BAAA,IAAI,qCAAiB,EAAE;YAC1B,sCAAsC;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,GAAG,eAAe;gBAClB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,yBAAyB,CAAC,IAAI;aACrC,CAAC,CAAC;SACJ;IACH,CAAC;IAES,kBAAkB,CAAC,OAAY;QACvC,OAAO,OAAO,KAAK,kBAAkB,CAAC,QAAQ,CAAC;IACjD,CAAC;CACF;AAhJD,oCAgJC","sourcesContent":["import {isObservable} from \"../utils/objects/isObservable\";\nimport {isPromise} from \"../utils/objects/isPromise\";\nimport {isStream} from \"../utils/objects/isStream\";\n\n/**\n * @ignore\n */\nfunction isResponse(obj: any) {\n return obj.data && obj.headers && obj.status && obj.statusText;\n}\n\n/**\n * @ignore\n */\nexport enum AnyToPromiseStatus {\n PENDING = \"PENDING\",\n CANCELED = \"CANCELED\",\n RESOLVED = \"RESOLVED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AnyToPromiseResponseTypes {\n STREAM = \"STREAM\",\n BUFFER = \"BUFFER\",\n DATA = \"DATA\"\n}\n\nexport interface AnyPromiseResult<T = any> {\n state: AnyToPromiseStatus;\n type: AnyToPromiseResponseTypes;\n status?: number;\n headers?: Record<string, any>;\n data: T;\n}\n\nexport class AnyToPromise<T = any> {\n public status = AnyToPromiseStatus.PENDING;\n public args: any[];\n\n #resolves: any;\n #rejects: any;\n #hasNextFunction = false;\n\n readonly #promise: Promise<AnyPromiseResult<T>>;\n\n constructor({hasNextFunction = false}: {hasNextFunction?: boolean} = {}) {\n this.#hasNextFunction = hasNextFunction;\n\n this.#promise = new Promise((resolve: any, reject: any) => {\n this.#resolves = resolve;\n this.#rejects = reject;\n });\n }\n\n isDone(): boolean {\n return this.status !== AnyToPromiseStatus.PENDING;\n }\n\n get next() {\n this.#hasNextFunction = true;\n\n return (error?: any) => {\n if (this.isDone()) {\n return;\n }\n\n return error ? this.reject(error) : this.resolve({type: AnyToPromiseResponseTypes.DATA});\n };\n }\n\n /**\n *\n */\n async call(cb: Function): Promise<AnyPromiseResult<T>> {\n if (this.isDone()) {\n return this as any;\n }\n\n try {\n this.handle(cb());\n } catch (er) {\n this.reject(er);\n }\n\n return this.#promise;\n }\n\n reject(er: any) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.REJECTED);\n\n this.#rejects(er);\n }\n\n resolve(response: any = {}) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.RESOLVED);\n\n this.#resolves({...response, state: AnyToPromiseStatus.RESOLVED});\n }\n\n destroy() {}\n\n cancel() {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.CANCELED);\n\n return this.#resolves({state: AnyToPromiseStatus.CANCELED});\n }\n\n done(status: AnyToPromiseStatus) {\n this.destroy();\n this.status = status;\n }\n\n handle(process: any, additionalProps = {}): any {\n if (this.isDone()) {\n return;\n }\n\n if (process) {\n if (this.isCanceledResponse(process)) {\n // ABANDON\n return this.cancel();\n }\n\n if (isObservable(process)) {\n process = process.toPromise();\n }\n\n if (isResponse(process)) {\n return this.handle(process.data, {\n ...additionalProps,\n status: process.status,\n headers: process.headers\n });\n }\n\n if (isStream(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process});\n }\n if (isStream(process) || Buffer.isBuffer(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process});\n }\n\n if (isPromise(process)) {\n return process\n .then((result: any) => this.handle(result, additionalProps))\n .catch((error: any) => {\n if (error.response && isResponse(error.response)) {\n return this.handle(error.response);\n }\n return this.reject(error);\n });\n }\n }\n\n if (!this.#hasNextFunction) {\n // no next function and empty response\n return this.resolve({\n ...additionalProps,\n data: process,\n type: AnyToPromiseResponseTypes.DATA\n });\n }\n }\n\n protected isCanceledResponse(process: any) {\n return process === AnyToPromiseStatus.CANCELED;\n }\n}\n"]}
package/lib/cjs/index.js CHANGED
@@ -4,83 +4,83 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const tslib_1 = require("tslib");
7
- (0, tslib_1.__exportStar)(require("./decorators/configurable"), exports);
8
- (0, tslib_1.__exportStar)(require("./decorators/deprecated"), exports);
9
- (0, tslib_1.__exportStar)(require("./decorators/enumerable"), exports);
10
- (0, tslib_1.__exportStar)(require("./decorators/notConfigurable"), exports);
11
- (0, tslib_1.__exportStar)(require("./decorators/notEnumerable"), exports);
12
- (0, tslib_1.__exportStar)(require("./decorators/readOnly"), exports);
13
- (0, tslib_1.__exportStar)(require("./decorators/storeFn"), exports);
14
- (0, tslib_1.__exportStar)(require("./decorators/storeMerge"), exports);
15
- (0, tslib_1.__exportStar)(require("./decorators/storeSet"), exports);
16
- (0, tslib_1.__exportStar)(require("./decorators/writable"), exports);
17
- (0, tslib_1.__exportStar)(require("./domain/AnyToPromise"), exports);
18
- (0, tslib_1.__exportStar)(require("./domain/DecoratorTypes"), exports);
19
- (0, tslib_1.__exportStar)(require("./domain/Env"), exports);
20
- (0, tslib_1.__exportStar)(require("./domain/Hooks"), exports);
21
- (0, tslib_1.__exportStar)(require("./domain/Metadata"), exports);
22
- (0, tslib_1.__exportStar)(require("./domain/Store"), exports);
23
- (0, tslib_1.__exportStar)(require("./domain/Type"), exports);
24
- (0, tslib_1.__exportStar)(require("./errors/UnsupportedDecoratorType"), exports);
25
- (0, tslib_1.__exportStar)(require("./interfaces/AnyDecorator"), exports);
26
- (0, tslib_1.__exportStar)(require("./interfaces/DecoratorParameters"), exports);
27
- (0, tslib_1.__exportStar)(require("./interfaces/HashOf"), exports);
28
- (0, tslib_1.__exportStar)(require("./interfaces/MetadataTypes"), exports);
29
- (0, tslib_1.__exportStar)(require("./interfaces/ValueOf"), exports);
30
- (0, tslib_1.__exportStar)(require("./utils/catchError"), exports);
31
- (0, tslib_1.__exportStar)(require("./utils/proxyDelegation"), exports);
32
- (0, tslib_1.__exportStar)(require("./utils/uniq"), exports);
33
- (0, tslib_1.__exportStar)(require("./utils/decorators/decorateMethodsOf"), exports);
34
- (0, tslib_1.__exportStar)(require("./utils/decorators/decoratorArgs"), exports);
35
- (0, tslib_1.__exportStar)(require("./utils/decorators/decoratorTypeOf"), exports);
36
- (0, tslib_1.__exportStar)(require("./utils/decorators/inheritedDescriptorOf"), exports);
37
- (0, tslib_1.__exportStar)(require("./utils/decorators/useDecorators"), exports);
38
- (0, tslib_1.__exportStar)(require("./utils/decorators/useMethodDecorators"), exports);
39
- (0, tslib_1.__exportStar)(require("./utils/http/getHostInfoFromPort"), exports);
40
- (0, tslib_1.__exportStar)(require("./utils/imports/importPackage"), exports);
41
- (0, tslib_1.__exportStar)(require("./utils/objects/ancestorOf"), exports);
42
- (0, tslib_1.__exportStar)(require("./utils/objects/ancestorsOf"), exports);
43
- (0, tslib_1.__exportStar)(require("./utils/objects/classOf"), exports);
44
- (0, tslib_1.__exportStar)(require("./utils/objects/cleanObject"), exports);
45
- (0, tslib_1.__exportStar)(require("./utils/objects/constructorOf"), exports);
46
- (0, tslib_1.__exportStar)(require("./utils/objects/createInstance"), exports);
47
- (0, tslib_1.__exportStar)(require("./utils/objects/deepClone"), exports);
48
- (0, tslib_1.__exportStar)(require("./utils/objects/deepExtends"), exports);
49
- (0, tslib_1.__exportStar)(require("./utils/objects/deepMerge"), exports);
50
- (0, tslib_1.__exportStar)(require("./utils/objects/descriptorOf"), exports);
51
- (0, tslib_1.__exportStar)(require("./utils/objects/getClassOrSymbol"), exports);
52
- (0, tslib_1.__exportStar)(require("./utils/objects/getConstructorArgNames"), exports);
53
- (0, tslib_1.__exportStar)(require("./utils/objects/getEnumerableKeys"), exports);
54
- (0, tslib_1.__exportStar)(require("./utils/objects/getValue"), exports);
55
- (0, tslib_1.__exportStar)(require("./utils/objects/isArray"), exports);
56
- (0, tslib_1.__exportStar)(require("./utils/objects/isArrowFn"), exports);
57
- (0, tslib_1.__exportStar)(require("./utils/objects/isBoolean"), exports);
58
- (0, tslib_1.__exportStar)(require("./utils/objects/isBuffer"), exports);
59
- (0, tslib_1.__exportStar)(require("./utils/objects/isClass"), exports);
60
- (0, tslib_1.__exportStar)(require("./utils/objects/isCollection"), exports);
61
- (0, tslib_1.__exportStar)(require("./utils/objects/isDate"), exports);
62
- (0, tslib_1.__exportStar)(require("./utils/objects/isEmpty"), exports);
63
- (0, tslib_1.__exportStar)(require("./utils/objects/isEnumerable"), exports);
64
- (0, tslib_1.__exportStar)(require("./utils/objects/isFunction"), exports);
65
- (0, tslib_1.__exportStar)(require("./utils/objects/isInheritedFrom"), exports);
66
- (0, tslib_1.__exportStar)(require("./utils/objects/isNil"), exports);
67
- (0, tslib_1.__exportStar)(require("./utils/objects/isNumber"), exports);
68
- (0, tslib_1.__exportStar)(require("./utils/objects/isObject"), exports);
69
- (0, tslib_1.__exportStar)(require("./utils/objects/isObservable"), exports);
70
- (0, tslib_1.__exportStar)(require("./utils/objects/isPlainObject"), exports);
71
- (0, tslib_1.__exportStar)(require("./utils/objects/isPrimitive"), exports);
72
- (0, tslib_1.__exportStar)(require("./utils/objects/isPromise"), exports);
73
- (0, tslib_1.__exportStar)(require("./utils/objects/isProtectedKey"), exports);
74
- (0, tslib_1.__exportStar)(require("./utils/objects/isSerializable"), exports);
75
- (0, tslib_1.__exportStar)(require("./utils/objects/isStream"), exports);
76
- (0, tslib_1.__exportStar)(require("./utils/objects/isString"), exports);
77
- (0, tslib_1.__exportStar)(require("./utils/objects/isSymbol"), exports);
78
- (0, tslib_1.__exportStar)(require("./utils/objects/methodsOf"), exports);
79
- (0, tslib_1.__exportStar)(require("./utils/objects/nameOf"), exports);
80
- (0, tslib_1.__exportStar)(require("./utils/objects/objectKeys"), exports);
81
- (0, tslib_1.__exportStar)(require("./utils/objects/primitiveOf"), exports);
82
- (0, tslib_1.__exportStar)(require("./utils/objects/prototypeOf"), exports);
83
- (0, tslib_1.__exportStar)(require("./utils/objects/setValue"), exports);
84
- (0, tslib_1.__exportStar)(require("./utils/objects/toMap"), exports);
85
- (0, tslib_1.__exportStar)(require("./utils/objects/toStringConstructor"), exports);
7
+ tslib_1.__exportStar(require("./decorators/configurable"), exports);
8
+ tslib_1.__exportStar(require("./decorators/deprecated"), exports);
9
+ tslib_1.__exportStar(require("./decorators/enumerable"), exports);
10
+ tslib_1.__exportStar(require("./decorators/notConfigurable"), exports);
11
+ tslib_1.__exportStar(require("./decorators/notEnumerable"), exports);
12
+ tslib_1.__exportStar(require("./decorators/readOnly"), exports);
13
+ tslib_1.__exportStar(require("./decorators/storeFn"), exports);
14
+ tslib_1.__exportStar(require("./decorators/storeMerge"), exports);
15
+ tslib_1.__exportStar(require("./decorators/storeSet"), exports);
16
+ tslib_1.__exportStar(require("./decorators/writable"), exports);
17
+ tslib_1.__exportStar(require("./domain/AnyToPromise"), exports);
18
+ tslib_1.__exportStar(require("./domain/DecoratorTypes"), exports);
19
+ tslib_1.__exportStar(require("./domain/Env"), exports);
20
+ tslib_1.__exportStar(require("./domain/Hooks"), exports);
21
+ tslib_1.__exportStar(require("./domain/Metadata"), exports);
22
+ tslib_1.__exportStar(require("./domain/Store"), exports);
23
+ tslib_1.__exportStar(require("./domain/Type"), exports);
24
+ tslib_1.__exportStar(require("./errors/UnsupportedDecoratorType"), exports);
25
+ tslib_1.__exportStar(require("./interfaces/AnyDecorator"), exports);
26
+ tslib_1.__exportStar(require("./interfaces/DecoratorParameters"), exports);
27
+ tslib_1.__exportStar(require("./interfaces/HashOf"), exports);
28
+ tslib_1.__exportStar(require("./interfaces/MetadataTypes"), exports);
29
+ tslib_1.__exportStar(require("./interfaces/ValueOf"), exports);
30
+ tslib_1.__exportStar(require("./utils/catchError"), exports);
31
+ tslib_1.__exportStar(require("./utils/proxyDelegation"), exports);
32
+ tslib_1.__exportStar(require("./utils/uniq"), exports);
33
+ tslib_1.__exportStar(require("./utils/decorators/decorateMethodsOf"), exports);
34
+ tslib_1.__exportStar(require("./utils/decorators/decoratorArgs"), exports);
35
+ tslib_1.__exportStar(require("./utils/decorators/decoratorTypeOf"), exports);
36
+ tslib_1.__exportStar(require("./utils/decorators/inheritedDescriptorOf"), exports);
37
+ tslib_1.__exportStar(require("./utils/decorators/useDecorators"), exports);
38
+ tslib_1.__exportStar(require("./utils/decorators/useMethodDecorators"), exports);
39
+ tslib_1.__exportStar(require("./utils/http/getHostInfoFromPort"), exports);
40
+ tslib_1.__exportStar(require("./utils/imports/importPackage"), exports);
41
+ tslib_1.__exportStar(require("./utils/objects/ancestorOf"), exports);
42
+ tslib_1.__exportStar(require("./utils/objects/ancestorsOf"), exports);
43
+ tslib_1.__exportStar(require("./utils/objects/classOf"), exports);
44
+ tslib_1.__exportStar(require("./utils/objects/cleanObject"), exports);
45
+ tslib_1.__exportStar(require("./utils/objects/constructorOf"), exports);
46
+ tslib_1.__exportStar(require("./utils/objects/createInstance"), exports);
47
+ tslib_1.__exportStar(require("./utils/objects/deepClone"), exports);
48
+ tslib_1.__exportStar(require("./utils/objects/deepExtends"), exports);
49
+ tslib_1.__exportStar(require("./utils/objects/deepMerge"), exports);
50
+ tslib_1.__exportStar(require("./utils/objects/descriptorOf"), exports);
51
+ tslib_1.__exportStar(require("./utils/objects/getClassOrSymbol"), exports);
52
+ tslib_1.__exportStar(require("./utils/objects/getConstructorArgNames"), exports);
53
+ tslib_1.__exportStar(require("./utils/objects/getEnumerableKeys"), exports);
54
+ tslib_1.__exportStar(require("./utils/objects/getValue"), exports);
55
+ tslib_1.__exportStar(require("./utils/objects/isArray"), exports);
56
+ tslib_1.__exportStar(require("./utils/objects/isArrowFn"), exports);
57
+ tslib_1.__exportStar(require("./utils/objects/isBoolean"), exports);
58
+ tslib_1.__exportStar(require("./utils/objects/isBuffer"), exports);
59
+ tslib_1.__exportStar(require("./utils/objects/isClass"), exports);
60
+ tslib_1.__exportStar(require("./utils/objects/isCollection"), exports);
61
+ tslib_1.__exportStar(require("./utils/objects/isDate"), exports);
62
+ tslib_1.__exportStar(require("./utils/objects/isEmpty"), exports);
63
+ tslib_1.__exportStar(require("./utils/objects/isEnumerable"), exports);
64
+ tslib_1.__exportStar(require("./utils/objects/isFunction"), exports);
65
+ tslib_1.__exportStar(require("./utils/objects/isInheritedFrom"), exports);
66
+ tslib_1.__exportStar(require("./utils/objects/isNil"), exports);
67
+ tslib_1.__exportStar(require("./utils/objects/isNumber"), exports);
68
+ tslib_1.__exportStar(require("./utils/objects/isObject"), exports);
69
+ tslib_1.__exportStar(require("./utils/objects/isObservable"), exports);
70
+ tslib_1.__exportStar(require("./utils/objects/isPlainObject"), exports);
71
+ tslib_1.__exportStar(require("./utils/objects/isPrimitive"), exports);
72
+ tslib_1.__exportStar(require("./utils/objects/isPromise"), exports);
73
+ tslib_1.__exportStar(require("./utils/objects/isProtectedKey"), exports);
74
+ tslib_1.__exportStar(require("./utils/objects/isSerializable"), exports);
75
+ tslib_1.__exportStar(require("./utils/objects/isStream"), exports);
76
+ tslib_1.__exportStar(require("./utils/objects/isString"), exports);
77
+ tslib_1.__exportStar(require("./utils/objects/isSymbol"), exports);
78
+ tslib_1.__exportStar(require("./utils/objects/methodsOf"), exports);
79
+ tslib_1.__exportStar(require("./utils/objects/nameOf"), exports);
80
+ tslib_1.__exportStar(require("./utils/objects/objectKeys"), exports);
81
+ tslib_1.__exportStar(require("./utils/objects/primitiveOf"), exports);
82
+ tslib_1.__exportStar(require("./utils/objects/prototypeOf"), exports);
83
+ tslib_1.__exportStar(require("./utils/objects/setValue"), exports);
84
+ tslib_1.__exportStar(require("./utils/objects/toMap"), exports);
85
+ tslib_1.__exportStar(require("./utils/objects/toStringConstructor"), exports);
86
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yEAA0C;AAC1C,uEAAwC;AACxC,uEAAwC;AACxC,4EAA6C;AAC7C,0EAA2C;AAC3C,qEAAsC;AACtC,oEAAqC;AACrC,uEAAwC;AACxC,qEAAsC;AACtC,qEAAsC;AACtC,qEAAsC;AACtC,uEAAwC;AACxC,4DAA6B;AAC7B,8DAA+B;AAC/B,iEAAkC;AAClC,8DAA+B;AAC/B,6DAA8B;AAC9B,iFAAkD;AAClD,yEAA0C;AAC1C,gFAAiD;AACjD,mEAAoC;AACpC,0EAA2C;AAC3C,oEAAqC;AACrC,kEAAmC;AACnC,uEAAwC;AACxC,4DAA6B;AAC7B,oFAAqD;AACrD,gFAAiD;AACjD,kFAAmD;AACnD,wFAAyD;AACzD,gFAAiD;AACjD,sFAAuD;AACvD,gFAAiD;AACjD,6EAA8C;AAC9C,0EAA2C;AAC3C,2EAA4C;AAC5C,uEAAwC;AACxC,2EAA4C;AAC5C,6EAA8C;AAC9C,8EAA+C;AAC/C,yEAA0C;AAC1C,2EAA4C;AAC5C,yEAA0C;AAC1C,4EAA6C;AAC7C,gFAAiD;AACjD,sFAAuD;AACvD,iFAAkD;AAClD,wEAAyC;AACzC,uEAAwC;AACxC,yEAA0C;AAC1C,yEAA0C;AAC1C,wEAAyC;AACzC,uEAAwC;AACxC,4EAA6C;AAC7C,sEAAuC;AACvC,uEAAwC;AACxC,4EAA6C;AAC7C,0EAA2C;AAC3C,+EAAgD;AAChD,qEAAsC;AACtC,wEAAyC;AACzC,wEAAyC;AACzC,4EAA6C;AAC7C,6EAA8C;AAC9C,2EAA4C;AAC5C,yEAA0C;AAC1C,8EAA+C;AAC/C,8EAA+C;AAC/C,wEAAyC;AACzC,wEAAyC;AACzC,wEAAyC;AACzC,yEAA0C;AAC1C,sEAAuC;AACvC,0EAA2C;AAC3C,2EAA4C;AAC5C,2EAA4C;AAC5C,wEAAyC;AACzC,qEAAsC;AACtC,mFAAoD","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/deepExtends\";\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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oEAA0C;AAC1C,kEAAwC;AACxC,kEAAwC;AACxC,uEAA6C;AAC7C,qEAA2C;AAC3C,gEAAsC;AACtC,+DAAqC;AACrC,kEAAwC;AACxC,gEAAsC;AACtC,gEAAsC;AACtC,gEAAsC;AACtC,kEAAwC;AACxC,uDAA6B;AAC7B,yDAA+B;AAC/B,4DAAkC;AAClC,yDAA+B;AAC/B,wDAA8B;AAC9B,4EAAkD;AAClD,oEAA0C;AAC1C,2EAAiD;AACjD,8DAAoC;AACpC,qEAA2C;AAC3C,+DAAqC;AACrC,6DAAmC;AACnC,kEAAwC;AACxC,uDAA6B;AAC7B,+EAAqD;AACrD,2EAAiD;AACjD,6EAAmD;AACnD,mFAAyD;AACzD,2EAAiD;AACjD,iFAAuD;AACvD,2EAAiD;AACjD,wEAA8C;AAC9C,qEAA2C;AAC3C,sEAA4C;AAC5C,kEAAwC;AACxC,sEAA4C;AAC5C,wEAA8C;AAC9C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,oEAA0C;AAC1C,uEAA6C;AAC7C,2EAAiD;AACjD,iFAAuD;AACvD,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,oEAA0C;AAC1C,oEAA0C;AAC1C,mEAAyC;AACzC,kEAAwC;AACxC,uEAA6C;AAC7C,iEAAuC;AACvC,kEAAwC;AACxC,uEAA6C;AAC7C,qEAA2C;AAC3C,0EAAgD;AAChD,gEAAsC;AACtC,mEAAyC;AACzC,mEAAyC;AACzC,uEAA6C;AAC7C,wEAA8C;AAC9C,sEAA4C;AAC5C,oEAA0C;AAC1C,yEAA+C;AAC/C,yEAA+C;AAC/C,mEAAyC;AACzC,mEAAyC;AACzC,mEAAyC;AACzC,oEAA0C;AAC1C,iEAAuC;AACvC,qEAA2C;AAC3C,sEAA4C;AAC5C,sEAA4C;AAC5C,mEAAyC;AACzC,gEAAsC;AACtC,8EAAoD","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/deepExtends\";\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,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"importPackage.js","sourceRoot":"","sources":["../../../../src/utils/imports/importPackage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,WAAqB,GAAG,EAAE,mDAAQ,WAAW,GAAC,EAAE,QAAQ,GAAG,KAAK;IACvH,IAAI;QACF,OAAO,MAAM,QAAQ,EAAE,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,CAAC,CAAC;SACT;QAED,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAVD,sCAUC","sourcesContent":["export async function importPackage(packageName: string, loaderFn: Function = () => import(packageName), optional = false) {\n try {\n return await loaderFn();\n } catch (e) {\n if (!optional) {\n throw e;\n }\n\n return {};\n }\n}\n"]}
1
+ {"version":3,"file":"importPackage.js","sourceRoot":"","sources":["../../../../src/utils/imports/importPackage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,WAAqB,GAAG,EAAE,mDAAQ,WAAW,GAAC,EAAE,QAAQ,GAAG,KAAK;IACvH,IAAI;QACF,OAAO,MAAM,QAAQ,EAAE,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,CAAC,CAAC;SACT;QAED,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAVD,sCAUC","sourcesContent":["export async function importPackage(packageName: string, loaderFn: Function = () => import(packageName), optional = false) {\n try {\n return await loaderFn();\n } catch (e) {\n if (!optional) {\n throw e;\n }\n\n return {};\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,+CAA0C;AAC1C,+CAA0C;AAE1C;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAW;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IAEzB,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAA,yBAAW,EAAC,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;AAfD,8BAeC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {ancestorsOf} from \"./ancestorsOf\";\nimport {prototypeOf} from \"./prototypeOf\";\n\n/**\n * Return all methods for a given class.\n * @param target\n */\nexport function methodsOf(target: any) {\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
+ {"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,+CAA0C;AAC1C,+CAA0C;AAG1C;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAW;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IAEzB,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAA,yBAAW,EAAC,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;AAfD,8BAeC","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 +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;AAE1C;;;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\";\n\n/**\n * Return all methods for a given class.\n * @param target\n */\nexport function methodsOf(target: any) {\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
+ {"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,5 +1,9 @@
1
+ import { Type } from "../../domain/Type";
1
2
  /**
2
3
  * Return all methods for a given class.
3
4
  * @param target
4
5
  */
5
- export declare function methodsOf(target: any): any[];
6
+ export declare function methodsOf(target: any): {
7
+ target: Type;
8
+ propertyKey: string;
9
+ }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/core",
3
- "version": "6.107.5",
3
+ "version": "6.110.0",
4
4
  "description": "Core module for Ts.ED Framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "reflect-metadata": "^0.1.13",
25
- "tslib": "2.2.0"
25
+ "tslib": "2.3.1"
26
26
  },
27
27
  "devDependencies": {},
28
28
  "peerDependencies": {},