@tsed/core 7.0.0-beta.1 → 7.0.0-beta.12
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/jest.config.js +14 -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 +10 -10
- package/lib/cjs/domain/AnyToPromise.js.map +1 -1
- package/lib/cjs/errors/UnsupportedDecoratorType.js +5 -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 +1 -0
- 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/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 +3 -3
- package/lib/esm/domain/Metadata.js +1 -1
- package/lib/esm/domain/Store.js +8 -8
- package/lib/esm/errors/UnsupportedDecoratorType.js +3 -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 +6 -5
- 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/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/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 +3 -3
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MA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M,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"]}
|
|
@@ -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,SAAS,EAAC,GAAG,OAAO,CAAC;IAEtD,IAAI,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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C,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";
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./decorators/configurable";
|
|
5
|
+
export * from "./decorators/deprecated";
|
|
6
|
+
export * from "./decorators/enumerable";
|
|
7
|
+
export * from "./decorators/notConfigurable";
|
|
8
|
+
export * from "./decorators/notEnumerable";
|
|
9
|
+
export * from "./decorators/readOnly";
|
|
10
|
+
export * from "./decorators/storeFn";
|
|
11
|
+
export * from "./decorators/storeMerge";
|
|
12
|
+
export * from "./decorators/storeSet";
|
|
13
|
+
export * from "./decorators/writable";
|
|
14
|
+
export * from "./domain/AnyToPromise";
|
|
15
|
+
export * from "./domain/DecoratorTypes";
|
|
16
|
+
export * from "./domain/Env";
|
|
17
|
+
export * from "./domain/Hooks";
|
|
18
|
+
export * from "./domain/Metadata";
|
|
19
|
+
export * from "./domain/Store";
|
|
20
|
+
export * from "./domain/Type";
|
|
5
21
|
export * from "./errors/UnsupportedDecoratorType";
|
|
6
|
-
export * from "./
|
|
22
|
+
export * from "./interfaces/AnyDecorator";
|
|
23
|
+
export * from "./interfaces/DecoratorParameters";
|
|
24
|
+
export * from "./interfaces/HashOf";
|
|
25
|
+
export * from "./interfaces/MetadataTypes";
|
|
26
|
+
export * from "./interfaces/ValueOf";
|
|
27
|
+
export * from "./utils/catchError";
|
|
28
|
+
export * from "./utils/proxyDelegation";
|
|
29
|
+
export * from "./utils/uniq";
|
|
30
|
+
export * from "./utils/decorators/decorateMethodsOf";
|
|
31
|
+
export * from "./utils/decorators/decoratorArgs";
|
|
32
|
+
export * from "./utils/decorators/decoratorTypeOf";
|
|
33
|
+
export * from "./utils/decorators/inheritedDescriptorOf";
|
|
34
|
+
export * from "./utils/decorators/useDecorators";
|
|
35
|
+
export * from "./utils/decorators/useMethodDecorators";
|
|
36
|
+
export * from "./utils/http/getHostInfoFromPort";
|
|
37
|
+
export * from "./utils/imports/importPackage";
|
|
38
|
+
export * from "./utils/objects/ancestorOf";
|
|
39
|
+
export * from "./utils/objects/ancestorsOf";
|
|
40
|
+
export * from "./utils/objects/classOf";
|
|
41
|
+
export * from "./utils/objects/cleanObject";
|
|
42
|
+
export * from "./utils/objects/constructorOf";
|
|
43
|
+
export * from "./utils/objects/createInstance";
|
|
44
|
+
export * from "./utils/objects/deepClone";
|
|
45
|
+
export * from "./utils/objects/deepMerge";
|
|
46
|
+
export * from "./utils/objects/descriptorOf";
|
|
47
|
+
export * from "./utils/objects/getClassOrSymbol";
|
|
48
|
+
export * from "./utils/objects/getConstructorArgNames";
|
|
49
|
+
export * from "./utils/objects/getEnumerableKeys";
|
|
50
|
+
export * from "./utils/objects/getValue";
|
|
51
|
+
export * from "./utils/objects/isArray";
|
|
52
|
+
export * from "./utils/objects/isArrowFn";
|
|
53
|
+
export * from "./utils/objects/isBoolean";
|
|
54
|
+
export * from "./utils/objects/isBuffer";
|
|
55
|
+
export * from "./utils/objects/isClass";
|
|
56
|
+
export * from "./utils/objects/isCollection";
|
|
57
|
+
export * from "./utils/objects/isDate";
|
|
58
|
+
export * from "./utils/objects/isEmpty";
|
|
59
|
+
export * from "./utils/objects/isEnumerable";
|
|
60
|
+
export * from "./utils/objects/isFunction";
|
|
61
|
+
export * from "./utils/objects/isInheritedFrom";
|
|
62
|
+
export * from "./utils/objects/isNil";
|
|
63
|
+
export * from "./utils/objects/isNumber";
|
|
64
|
+
export * from "./utils/objects/isObject";
|
|
65
|
+
export * from "./utils/objects/isObservable";
|
|
66
|
+
export * from "./utils/objects/isPlainObject";
|
|
67
|
+
export * from "./utils/objects/isPrimitive";
|
|
68
|
+
export * from "./utils/objects/isPromise";
|
|
69
|
+
export * from "./utils/objects/isProtectedKey";
|
|
70
|
+
export * from "./utils/objects/isSerializable";
|
|
71
|
+
export * from "./utils/objects/isStream";
|
|
72
|
+
export * from "./utils/objects/isString";
|
|
73
|
+
export * from "./utils/objects/isSymbol";
|
|
74
|
+
export * from "./utils/objects/methodsOf";
|
|
75
|
+
export * from "./utils/objects/nameOf";
|
|
76
|
+
export * from "./utils/objects/objectKeys";
|
|
77
|
+
export * from "./utils/objects/primitiveOf";
|
|
78
|
+
export * from "./utils/objects/prototypeOf";
|
|
79
|
+
export * from "./utils/objects/setValue";
|
|
80
|
+
export * from "./utils/objects/toMap";
|
|
81
|
+
export * from "./utils/objects/toStringConstructor";
|
|
@@ -6,4 +6,4 @@ export interface DeepMergeOptions {
|
|
|
6
6
|
cleanUndefinedProps?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function mergeReducerBuilder(cb: DeepMergeComparatorCB): (collection: any[], value: any, options: DeepMergeOptions) => any[];
|
|
9
|
-
export declare function deepMerge<T
|
|
9
|
+
export declare function deepMerge<T = any, C = any>(source: T & any, obj: C & any, options?: DeepMergeOptions): (T & C) | undefined | null;
|
|
@@ -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):
|
|
6
|
+
export declare function methodsOf(target: any): {
|
|
7
|
+
target: Type;
|
|
8
|
+
propertyKey: string;
|
|
9
|
+
}[];
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/core",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.12",
|
|
4
4
|
"description": "Core module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,13 +14,15 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
18
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\"",
|
|
17
19
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
20
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
21
|
+
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
|
|
19
22
|
},
|
|
20
23
|
"dependencies": {
|
|
21
24
|
"reflect-metadata": "^0.1.13",
|
|
22
|
-
"tslib": "2.
|
|
25
|
+
"tslib": "2.3.1"
|
|
23
26
|
},
|
|
24
27
|
"devDependencies": {},
|
|
25
28
|
"peerDependencies": {},
|
|
@@ -27,7 +30,10 @@
|
|
|
27
30
|
"bugs": {
|
|
28
31
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
29
32
|
},
|
|
30
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
33
|
+
"homepage": "https://github.com/tsedio/tsed/tree/beta/packages/core",
|
|
31
34
|
"author": "Romain Lenzotti",
|
|
32
|
-
"license": "MIT"
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"tag": "beta"
|
|
38
|
+
}
|
|
33
39
|
}
|
package/readme.md
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
[](https://badge.fury.io/js/%40tsed%2Fcommon)
|
|
12
12
|
[](https://github.com/semantic-release/semantic-release)
|
|
13
13
|
[](https://github.com/prettier/prettier)
|
|
14
|
-
[](https://github.com/sponsors/romakita)
|
|
15
|
+
[](https://opencollective.com/tsed)
|
|
15
16
|
|
|
16
17
|
</div>
|
|
17
18
|
|
|
@@ -36,18 +37,17 @@ npm install --save @tsed/core
|
|
|
36
37
|
```
|
|
37
38
|
|
|
38
39
|
## Contributors
|
|
40
|
+
|
|
39
41
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html).
|
|
40
42
|
|
|
41
43
|
<a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
42
44
|
|
|
43
|
-
|
|
44
45
|
## Backers
|
|
45
46
|
|
|
46
47
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
47
48
|
|
|
48
49
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
|
|
49
50
|
|
|
50
|
-
|
|
51
51
|
## Sponsors
|
|
52
52
|
|
|
53
53
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -8,16 +8,5 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"exclude": ["node_modules", "test", "lib", "coverage", ".nyc_output", "**/*.spec.ts", "jest.config.js"]
|
|
23
12
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
|
-
/** */
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./deprecated"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./configurable"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./enumerable"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./writable"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./readOnly"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./notConfigurable"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./notEnumerable"), exports);
|
|
15
|
-
(0, tslib_1.__exportStar)(require("./storeSet"), exports);
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./storeMerge"), exports);
|
|
17
|
-
(0, tslib_1.__exportStar)(require("./storeFn"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM;AACN,4DAA6B;AAC7B,8DAA+B;AAC/B,4DAA6B;AAC7B,0DAA2B;AAC3B,0DAA2B;AAC3B,iEAAkC;AAClC,+DAAgC;AAChC,0DAA2B;AAC3B,4DAA6B;AAC7B,yDAA0B","sourcesContent":["/**\n * @module common/core\n */\n/** */\nexport * from \"./deprecated\";\nexport * from \"./configurable\";\nexport * from \"./enumerable\";\nexport * from \"./writable\";\nexport * from \"./readOnly\";\nexport * from \"./notConfigurable\";\nexport * from \"./notEnumerable\";\nexport * from \"./storeSet\";\nexport * from \"./storeMerge\";\nexport * from \"./storeFn\";\n"]}
|
package/lib/cjs/domain/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./DecoratorTypes"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./Env"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./Hooks"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./Metadata"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./Store"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./Type"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./AnyToPromise"), exports);
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,qDAAsB;AACtB,uDAAwB;AACxB,0DAA2B;AAC3B,uDAAwB;AACxB,sDAAuB;AACvB,8DAA+B","sourcesContent":["export * from \"./DecoratorTypes\";\nexport * from \"./Env\";\nexport * from \"./Hooks\";\nexport * from \"./Metadata\";\nexport * from \"./Store\";\nexport * from \"./Type\";\nexport * from \"./AnyToPromise\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"","sourcesContent":["export type {DecoratorParameters, DecoratorMethodParameters, StaticMethodDecorator} from \"./DecoratorParameters\";\nexport type {MetadataTypes} from \"./MetadataTypes\";\nexport type {ValueOf} from \"./ValueOf\";\nexport type {HashOf} from \"./HashOf\";\n"]}
|