@tsed/core 6.87.1 → 6.89.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.
- package/lib/{decorators → cjs/decorators}/configurable.d.ts +0 -0
- package/lib/cjs/decorators/configurable.js +18 -0
- package/lib/cjs/decorators/configurable.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/deprecated.d.ts +0 -0
- package/lib/cjs/decorators/deprecated.js +43 -0
- package/lib/cjs/decorators/deprecated.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/enumerable.d.ts +0 -0
- package/lib/cjs/decorators/enumerable.js +18 -0
- package/lib/cjs/decorators/enumerable.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
- package/lib/cjs/decorators/index.js +18 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/notConfigurable.d.ts +0 -0
- package/lib/cjs/decorators/notConfigurable.js +13 -0
- package/lib/cjs/decorators/notConfigurable.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/notEnumerable.d.ts +0 -0
- package/lib/cjs/decorators/notEnumerable.js +13 -0
- package/lib/cjs/decorators/notEnumerable.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/readOnly.d.ts +0 -0
- package/lib/cjs/decorators/readOnly.js +13 -0
- package/lib/cjs/decorators/readOnly.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/storeFn.d.ts +0 -0
- package/lib/cjs/decorators/storeFn.js +22 -0
- package/lib/cjs/decorators/storeFn.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/storeMerge.d.ts +0 -0
- package/lib/cjs/decorators/storeMerge.js +11 -0
- package/lib/cjs/decorators/storeMerge.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/storeSet.d.ts +0 -0
- package/lib/cjs/decorators/storeSet.js +11 -0
- package/lib/cjs/decorators/storeSet.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/writable.d.ts +0 -0
- package/lib/cjs/decorators/writable.js +18 -0
- package/lib/cjs/decorators/writable.js.map +1 -0
- package/lib/{domain → cjs/domain}/AnyToPromise.d.ts +0 -0
- package/lib/cjs/domain/AnyToPromise.js +148 -0
- package/lib/cjs/domain/AnyToPromise.js.map +1 -0
- package/lib/{domain → cjs/domain}/DecoratorTypes.d.ts +0 -0
- package/lib/cjs/domain/DecoratorTypes.js +15 -0
- package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
- package/lib/{domain → cjs/domain}/Env.d.ts +0 -0
- package/lib/cjs/domain/Env.js +19 -0
- package/lib/cjs/domain/Env.js.map +1 -0
- package/lib/{domain → cjs/domain}/Hooks.d.ts +0 -0
- package/lib/cjs/domain/Hooks.js +89 -0
- package/lib/cjs/domain/Hooks.js.map +1 -0
- package/lib/{domain → cjs/domain}/Metadata.d.ts +0 -0
- package/lib/cjs/domain/Metadata.js +508 -0
- package/lib/cjs/domain/Metadata.js.map +1 -0
- package/lib/{domain → cjs/domain}/Store.d.ts +0 -0
- package/lib/cjs/domain/Store.js +157 -0
- package/lib/cjs/domain/Store.js.map +1 -0
- package/lib/{domain → cjs/domain}/Type.d.ts +0 -0
- package/lib/cjs/domain/Type.js +7 -0
- package/lib/cjs/domain/Type.js.map +1 -0
- package/lib/{domain → cjs/domain}/index.d.ts +0 -0
- package/lib/cjs/domain/index.js +11 -0
- package/lib/cjs/domain/index.js.map +1 -0
- package/lib/{errors → cjs/errors}/UnsupportedDecoratorType.d.ts +0 -0
- package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
- package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
- package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- package/lib/cjs/index.js +9 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/AnyDecorator.d.ts +0 -0
- package/lib/cjs/interfaces/AnyDecorator.js +3 -0
- package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/DecoratorParameters.d.ts +0 -0
- package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
- package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/HashOf.d.ts +0 -0
- package/lib/cjs/interfaces/HashOf.js +3 -0
- package/lib/cjs/interfaces/HashOf.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/MetadataTypes.d.ts +0 -0
- package/lib/cjs/interfaces/MetadataTypes.js +3 -0
- package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/ValueOf.d.ts +0 -0
- package/lib/cjs/interfaces/ValueOf.js +3 -0
- package/lib/cjs/interfaces/ValueOf.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
- package/lib/cjs/interfaces/index.js +3 -0
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/catchError.d.ts +0 -0
- package/lib/cjs/utils/catchError.js +22 -0
- package/lib/cjs/utils/catchError.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/decorateMethodsOf.d.ts +0 -0
- package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
- package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/decoratorArgs.d.ts +0 -0
- package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
- package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/decoratorTypeOf.d.ts +0 -0
- package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
- package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
- package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
- package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/useDecorators.d.ts +0 -0
- package/lib/cjs/utils/decorators/useDecorators.js +14 -0
- package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
- package/lib/{utils → cjs/utils}/decorators/useMethodDecorators.d.ts +0 -0
- package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
- package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
- package/lib/{utils → cjs/utils}/imports/importPackage.d.ts +0 -0
- package/lib/cjs/utils/imports/importPackage.js +35 -0
- package/lib/cjs/utils/imports/importPackage.js.map +1 -0
- package/lib/{utils → cjs/utils}/index.d.ts +0 -0
- package/lib/cjs/utils/index.js +18 -0
- package/lib/cjs/utils/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/ancestorOf.d.ts +0 -0
- package/lib/cjs/utils/objects/ancestorOf.js +12 -0
- package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/ancestorsOf.d.ts +0 -0
- package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
- package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/classOf.d.ts +0 -0
- package/lib/cjs/utils/objects/classOf.js +23 -0
- package/lib/cjs/utils/objects/classOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/cleanObject.d.ts +0 -0
- package/lib/cjs/utils/objects/cleanObject.js +24 -0
- package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/constructorOf.d.ts +0 -0
- package/lib/cjs/utils/objects/constructorOf.js +20 -0
- package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/createInstance.d.ts +0 -0
- package/lib/cjs/utils/objects/createInstance.js +9 -0
- package/lib/cjs/utils/objects/createInstance.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/deepClone.d.ts +0 -0
- package/lib/cjs/utils/objects/deepClone.js +57 -0
- package/lib/cjs/utils/objects/deepClone.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/deepExtends.d.ts +0 -0
- package/lib/cjs/utils/objects/deepExtends.js +79 -0
- package/lib/cjs/utils/objects/deepExtends.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/deepMerge.d.ts +0 -0
- package/lib/cjs/utils/objects/deepMerge.js +63 -0
- package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/descriptorOf.d.ts +0 -0
- package/lib/cjs/utils/objects/descriptorOf.js +19 -0
- package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/getClassOrSymbol.d.ts +0 -0
- package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
- package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/getConstructorArgNames.d.ts +0 -0
- package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
- package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/getEnumerableKeys.d.ts +0 -0
- package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
- package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/getValue.d.ts +0 -0
- package/lib/cjs/utils/objects/getValue.js +49 -0
- package/lib/cjs/utils/objects/getValue.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/index.d.ts +0 -0
- package/lib/cjs/utils/objects/index.js +47 -0
- package/lib/cjs/utils/objects/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isArray.d.ts +0 -0
- package/lib/cjs/utils/objects/isArray.js +23 -0
- package/lib/cjs/utils/objects/isArray.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isArrowFn.d.ts +0 -0
- package/lib/cjs/utils/objects/isArrowFn.js +9 -0
- package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isBoolean.d.ts +0 -0
- package/lib/cjs/utils/objects/isBoolean.js +17 -0
- package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isClass.d.ts +0 -0
- package/lib/cjs/utils/objects/isClass.js +26 -0
- package/lib/cjs/utils/objects/isClass.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isCollection.d.ts +0 -0
- package/lib/cjs/utils/objects/isCollection.js +22 -0
- package/lib/cjs/utils/objects/isCollection.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isDate.d.ts +0 -0
- package/lib/cjs/utils/objects/isDate.js +13 -0
- package/lib/cjs/utils/objects/isDate.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isEmpty.d.ts +0 -0
- package/lib/cjs/utils/objects/isEmpty.js +14 -0
- package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isEnumerable.d.ts +0 -0
- package/lib/cjs/utils/objects/isEnumerable.js +22 -0
- package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isFunction.d.ts +0 -0
- package/lib/cjs/utils/objects/isFunction.js +8 -0
- package/lib/cjs/utils/objects/isFunction.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isInheritedFrom.d.ts +0 -0
- package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
- package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isNil.d.ts +0 -0
- package/lib/cjs/utils/objects/isNil.js +8 -0
- package/lib/cjs/utils/objects/isNil.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isNumber.d.ts +0 -0
- package/lib/cjs/utils/objects/isNumber.js +17 -0
- package/lib/cjs/utils/objects/isNumber.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isObject.d.ts +0 -0
- package/lib/cjs/utils/objects/isObject.js +8 -0
- package/lib/cjs/utils/objects/isObject.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isObservable.d.ts +0 -0
- package/lib/cjs/utils/objects/isObservable.js +8 -0
- package/lib/cjs/utils/objects/isObservable.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isPlainObject.d.ts +0 -0
- package/lib/cjs/utils/objects/isPlainObject.js +18 -0
- package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isPrimitive.d.ts +0 -0
- package/lib/cjs/utils/objects/isPrimitive.js +30 -0
- package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isPromise.d.ts +0 -0
- package/lib/cjs/utils/objects/isPromise.js +16 -0
- package/lib/cjs/utils/objects/isPromise.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isProtectedKey.d.ts +0 -0
- package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
- package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isSerializable.d.ts +0 -0
- package/lib/cjs/utils/objects/isSerializable.js +13 -0
- package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isStream.d.ts +0 -0
- package/lib/cjs/utils/objects/isStream.js +8 -0
- package/lib/cjs/utils/objects/isStream.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isString.d.ts +0 -0
- package/lib/cjs/utils/objects/isString.js +16 -0
- package/lib/cjs/utils/objects/isString.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/isSymbol.d.ts +0 -0
- package/lib/cjs/utils/objects/isSymbol.js +16 -0
- package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/methodsOf.d.ts +0 -0
- package/lib/cjs/utils/objects/methodsOf.js +25 -0
- package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/nameOf.d.ts +0 -0
- package/lib/cjs/utils/objects/nameOf.js +32 -0
- package/lib/cjs/utils/objects/nameOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/objectKeys.d.ts +0 -0
- package/lib/cjs/utils/objects/objectKeys.js +9 -0
- package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/primitiveOf.d.ts +0 -0
- package/lib/cjs/utils/objects/primitiveOf.js +20 -0
- package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/prototypeOf.d.ts +0 -0
- package/lib/cjs/utils/objects/prototypeOf.js +14 -0
- package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/setValue.d.ts +0 -0
- package/lib/cjs/utils/objects/setValue.js +34 -0
- package/lib/cjs/utils/objects/setValue.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/toMap.d.ts +0 -0
- package/lib/cjs/utils/objects/toMap.js +32 -0
- package/lib/cjs/utils/objects/toMap.js.map +1 -0
- package/lib/{utils → cjs/utils}/objects/toStringConstructor.d.ts +0 -0
- package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
- package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
- package/lib/{utils → cjs/utils}/proxyDelegation.d.ts +0 -0
- package/lib/cjs/utils/proxyDelegation.js +54 -0
- package/lib/cjs/utils/proxyDelegation.js.map +1 -0
- package/lib/{utils → cjs/utils}/uniq.d.ts +0 -0
- package/lib/cjs/utils/uniq.js +16 -0
- package/lib/cjs/utils/uniq.js.map +1 -0
- package/lib/esm/decorators/configurable.js +14 -0
- package/lib/esm/decorators/configurable.js.map +1 -0
- package/lib/esm/decorators/deprecated.js +39 -0
- package/lib/esm/decorators/deprecated.js.map +1 -0
- package/lib/esm/decorators/enumerable.js +14 -0
- package/lib/esm/decorators/enumerable.js.map +1 -0
- package/lib/esm/decorators/index.js +15 -0
- package/lib/esm/decorators/index.js.map +1 -0
- package/lib/esm/decorators/notConfigurable.js +9 -0
- package/lib/esm/decorators/notConfigurable.js.map +1 -0
- package/lib/esm/decorators/notEnumerable.js +9 -0
- package/lib/esm/decorators/notEnumerable.js.map +1 -0
- package/lib/esm/decorators/readOnly.js +9 -0
- package/lib/esm/decorators/readOnly.js.map +1 -0
- package/lib/esm/decorators/storeFn.js +18 -0
- package/lib/esm/decorators/storeFn.js.map +1 -0
- package/lib/esm/decorators/storeMerge.js +7 -0
- package/lib/esm/decorators/storeMerge.js.map +1 -0
- package/lib/esm/decorators/storeSet.js +7 -0
- package/lib/esm/decorators/storeSet.js.map +1 -0
- package/lib/esm/decorators/writable.js +14 -0
- package/lib/esm/decorators/writable.js.map +1 -0
- package/lib/esm/domain/AnyToPromise.js +144 -0
- package/lib/esm/domain/AnyToPromise.js.map +1 -0
- package/lib/esm/domain/DecoratorTypes.js +12 -0
- package/lib/esm/domain/DecoratorTypes.js.map +1 -0
- package/lib/esm/domain/Env.js +16 -0
- package/lib/esm/domain/Env.js.map +1 -0
- package/lib/esm/domain/Hooks.js +85 -0
- package/lib/esm/domain/Hooks.js.map +1 -0
- package/lib/esm/domain/Metadata.js +504 -0
- package/lib/esm/domain/Metadata.js.map +1 -0
- package/lib/esm/domain/Store.js +153 -0
- package/lib/esm/domain/Store.js.map +1 -0
- package/lib/esm/domain/Type.js +4 -0
- package/lib/esm/domain/Type.js.map +1 -0
- package/lib/esm/domain/index.js +8 -0
- package/lib/esm/domain/index.js.map +1 -0
- package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
- package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/AnyDecorator.js +2 -0
- package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
- package/lib/esm/interfaces/DecoratorParameters.js +2 -0
- package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
- package/lib/esm/interfaces/HashOf.js +2 -0
- package/lib/esm/interfaces/HashOf.js.map +1 -0
- package/lib/esm/interfaces/MetadataTypes.js +2 -0
- package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
- package/lib/esm/interfaces/ValueOf.js +2 -0
- package/lib/esm/interfaces/ValueOf.js.map +1 -0
- package/lib/esm/interfaces/index.js +2 -0
- package/lib/esm/interfaces/index.js.map +1 -0
- package/lib/esm/utils/catchError.js +17 -0
- package/lib/esm/utils/catchError.js.map +1 -0
- package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
- package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
- package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
- package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
- package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
- package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
- package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
- package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
- package/lib/esm/utils/decorators/useDecorators.js +10 -0
- package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
- package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
- package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
- package/lib/esm/utils/imports/importPackage.js +12 -0
- package/lib/esm/utils/imports/importPackage.js.map +1 -0
- package/lib/esm/utils/index.js +15 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/objects/ancestorOf.js +7 -0
- package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
- package/lib/esm/utils/objects/ancestorsOf.js +18 -0
- package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
- package/lib/esm/utils/objects/classOf.js +18 -0
- package/lib/esm/utils/objects/classOf.js.map +1 -0
- package/lib/esm/utils/objects/cleanObject.js +20 -0
- package/lib/esm/utils/objects/cleanObject.js.map +1 -0
- package/lib/esm/utils/objects/constructorOf.js +15 -0
- package/lib/esm/utils/objects/constructorOf.js.map +1 -0
- package/lib/esm/utils/objects/createInstance.js +5 -0
- package/lib/esm/utils/objects/createInstance.js.map +1 -0
- package/lib/esm/utils/objects/deepClone.js +53 -0
- package/lib/esm/utils/objects/deepClone.js.map +1 -0
- package/lib/esm/utils/objects/deepExtends.js +75 -0
- package/lib/esm/utils/objects/deepExtends.js.map +1 -0
- package/lib/esm/utils/objects/deepMerge.js +58 -0
- package/lib/esm/utils/objects/deepMerge.js.map +1 -0
- package/lib/esm/utils/objects/descriptorOf.js +14 -0
- package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
- package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
- package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
- package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
- package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
- package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
- package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
- package/lib/esm/utils/objects/getValue.js +45 -0
- package/lib/esm/utils/objects/getValue.js.map +1 -0
- package/lib/esm/utils/objects/index.js +44 -0
- package/lib/esm/utils/objects/index.js.map +1 -0
- package/lib/esm/utils/objects/isArray.js +18 -0
- package/lib/esm/utils/objects/isArray.js.map +1 -0
- package/lib/esm/utils/objects/isArrowFn.js +5 -0
- package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
- package/lib/esm/utils/objects/isBoolean.js +12 -0
- package/lib/esm/utils/objects/isBoolean.js.map +1 -0
- package/lib/esm/utils/objects/isClass.js +22 -0
- package/lib/esm/utils/objects/isClass.js.map +1 -0
- package/lib/esm/utils/objects/isCollection.js +18 -0
- package/lib/esm/utils/objects/isCollection.js.map +1 -0
- package/lib/esm/utils/objects/isDate.js +9 -0
- package/lib/esm/utils/objects/isDate.js.map +1 -0
- package/lib/esm/utils/objects/isEmpty.js +10 -0
- package/lib/esm/utils/objects/isEmpty.js.map +1 -0
- package/lib/esm/utils/objects/isEnumerable.js +18 -0
- package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
- package/lib/esm/utils/objects/isFunction.js +4 -0
- package/lib/esm/utils/objects/isFunction.js.map +1 -0
- package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
- package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
- package/lib/esm/utils/objects/isNil.js +4 -0
- package/lib/esm/utils/objects/isNil.js.map +1 -0
- package/lib/esm/utils/objects/isNumber.js +12 -0
- package/lib/esm/utils/objects/isNumber.js.map +1 -0
- package/lib/esm/utils/objects/isObject.js +4 -0
- package/lib/esm/utils/objects/isObject.js.map +1 -0
- package/lib/esm/utils/objects/isObservable.js +4 -0
- package/lib/esm/utils/objects/isObservable.js.map +1 -0
- package/lib/esm/utils/objects/isPlainObject.js +13 -0
- package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
- package/lib/esm/utils/objects/isPrimitive.js +24 -0
- package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
- package/lib/esm/utils/objects/isPromise.js +12 -0
- package/lib/esm/utils/objects/isPromise.js.map +1 -0
- package/lib/esm/utils/objects/isProtectedKey.js +8 -0
- package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
- package/lib/esm/utils/objects/isSerializable.js +9 -0
- package/lib/esm/utils/objects/isSerializable.js.map +1 -0
- package/lib/esm/utils/objects/isStream.js +4 -0
- package/lib/esm/utils/objects/isStream.js.map +1 -0
- package/lib/esm/utils/objects/isString.js +11 -0
- package/lib/esm/utils/objects/isString.js.map +1 -0
- package/lib/esm/utils/objects/isSymbol.js +11 -0
- package/lib/esm/utils/objects/isSymbol.js.map +1 -0
- package/lib/esm/utils/objects/methodsOf.js +21 -0
- package/lib/esm/utils/objects/methodsOf.js.map +1 -0
- package/lib/esm/utils/objects/nameOf.js +26 -0
- package/lib/esm/utils/objects/nameOf.js.map +1 -0
- package/lib/esm/utils/objects/objectKeys.js +5 -0
- package/lib/esm/utils/objects/objectKeys.js.map +1 -0
- package/lib/esm/utils/objects/primitiveOf.js +16 -0
- package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
- package/lib/esm/utils/objects/prototypeOf.js +10 -0
- package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
- package/lib/esm/utils/objects/setValue.js +30 -0
- package/lib/esm/utils/objects/setValue.js.map +1 -0
- package/lib/esm/utils/objects/toMap.js +28 -0
- package/lib/esm/utils/objects/toMap.js.map +1 -0
- package/lib/esm/utils/objects/toStringConstructor.js +8 -0
- package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
- package/lib/esm/utils/proxyDelegation.js +50 -0
- package/lib/esm/utils/proxyDelegation.js.map +1 -0
- package/lib/esm/utils/uniq.js +11 -0
- package/lib/esm/utils/uniq.js.map +1 -0
- package/lib/types/decorators/configurable.d.ts +2 -0
- package/lib/types/decorators/deprecated.d.ts +32 -0
- package/lib/types/decorators/enumerable.d.ts +2 -0
- package/lib/types/decorators/index.d.ts +14 -0
- package/lib/types/decorators/notConfigurable.d.ts +2 -0
- package/lib/types/decorators/notEnumerable.d.ts +2 -0
- package/lib/types/decorators/readOnly.d.ts +2 -0
- package/lib/types/decorators/storeFn.d.ts +9 -0
- package/lib/types/decorators/storeMerge.d.ts +1 -0
- package/lib/types/decorators/storeSet.d.ts +1 -0
- package/lib/types/decorators/writable.d.ts +2 -0
- package/lib/types/domain/AnyToPromise.d.ts +42 -0
- package/lib/types/domain/DecoratorTypes.d.ts +10 -0
- package/lib/types/domain/Env.d.ts +13 -0
- package/lib/types/domain/Hooks.d.ts +45 -0
- package/lib/types/domain/Metadata.d.ts +442 -0
- package/lib/types/domain/Store.d.ts +69 -0
- package/lib/types/domain/Type.d.ts +11 -0
- package/lib/types/domain/index.d.ts +7 -0
- package/lib/types/errors/UnsupportedDecoratorType.d.ts +5 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/interfaces/AnyDecorator.d.ts +1 -0
- package/lib/types/interfaces/DecoratorParameters.d.ts +3 -0
- package/lib/types/interfaces/HashOf.d.ts +1 -0
- package/lib/types/interfaces/MetadataTypes.d.ts +5 -0
- package/lib/types/interfaces/ValueOf.d.ts +1 -0
- package/lib/types/interfaces/index.d.ts +4 -0
- package/lib/types/utils/catchError.d.ts +2 -0
- package/lib/types/utils/decorators/decorateMethodsOf.d.ts +1 -0
- package/lib/types/utils/decorators/decoratorArgs.d.ts +2 -0
- package/lib/types/utils/decorators/decoratorTypeOf.d.ts +2 -0
- package/lib/types/utils/decorators/inheritedDescriptorOf.d.ts +1 -0
- package/lib/types/utils/decorators/useDecorators.d.ts +2 -0
- package/lib/types/utils/decorators/useMethodDecorators.d.ts +3 -0
- package/lib/types/utils/imports/importPackage.d.ts +1 -0
- package/lib/types/utils/index.d.ts +12 -0
- package/lib/types/utils/objects/ancestorOf.d.ts +2 -0
- package/lib/types/utils/objects/ancestorsOf.d.ts +6 -0
- package/lib/types/utils/objects/classOf.d.ts +13 -0
- package/lib/types/utils/objects/cleanObject.d.ts +6 -0
- package/lib/types/utils/objects/constructorOf.d.ts +11 -0
- package/lib/types/utils/objects/createInstance.d.ts +1 -0
- package/lib/types/utils/objects/deepClone.d.ts +6 -0
- package/lib/types/utils/objects/deepExtends.d.ts +10 -0
- package/lib/types/utils/objects/deepMerge.d.ts +9 -0
- package/lib/types/utils/objects/descriptorOf.d.ts +8 -0
- package/lib/types/utils/objects/getClassOrSymbol.d.ts +1 -0
- package/lib/types/utils/objects/getConstructorArgNames.d.ts +1 -0
- package/lib/types/utils/objects/getEnumerableKeys.d.ts +5 -0
- package/lib/types/utils/objects/getValue.d.ts +32 -0
- package/lib/types/utils/objects/index.d.ts +43 -0
- package/lib/types/utils/objects/isArray.d.ts +13 -0
- package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
- package/lib/types/utils/objects/isBoolean.d.ts +7 -0
- package/lib/types/utils/objects/isClass.d.ts +1 -0
- package/lib/types/utils/objects/isCollection.d.ts +6 -0
- package/lib/types/utils/objects/isDate.d.ts +6 -0
- package/lib/types/utils/objects/isEmpty.d.ts +6 -0
- package/lib/types/utils/objects/isEnumerable.d.ts +6 -0
- package/lib/types/utils/objects/isFunction.d.ts +1 -0
- package/lib/types/utils/objects/isInheritedFrom.d.ts +1 -0
- package/lib/types/utils/objects/isNil.d.ts +1 -0
- package/lib/types/utils/objects/isNumber.d.ts +7 -0
- package/lib/types/utils/objects/isObject.d.ts +1 -0
- package/lib/types/utils/objects/isObservable.d.ts +1 -0
- package/lib/types/utils/objects/isPlainObject.d.ts +7 -0
- package/lib/types/utils/objects/isPrimitive.d.ts +14 -0
- package/lib/types/utils/objects/isPromise.d.ts +7 -0
- package/lib/types/utils/objects/isProtectedKey.d.ts +5 -0
- package/lib/types/utils/objects/isSerializable.d.ts +1 -0
- package/lib/types/utils/objects/isStream.d.ts +1 -0
- package/lib/types/utils/objects/isString.d.ts +6 -0
- package/lib/types/utils/objects/isSymbol.d.ts +6 -0
- package/lib/types/utils/objects/methodsOf.d.ts +5 -0
- package/lib/types/utils/objects/nameOf.d.ts +14 -0
- package/lib/types/utils/objects/objectKeys.d.ts +1 -0
- package/lib/types/utils/objects/primitiveOf.d.ts +1 -0
- package/lib/types/utils/objects/prototypeOf.d.ts +6 -0
- package/lib/types/utils/objects/setValue.d.ts +1 -0
- package/lib/types/utils/objects/toMap.d.ts +3 -0
- package/lib/types/utils/objects/toStringConstructor.d.ts +1 -0
- package/lib/types/utils/proxyDelegation.d.ts +33 -0
- package/lib/types/utils/uniq.d.ts +2 -0
- package/package.json +10 -6
- package/tsconfig.compile.esm.json +23 -0
- package/lib/index.js +0 -2316
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -2206
- package/lib/index.modern.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ancestorsOf = void 0;
|
|
4
|
+
const classOf_1 = require("./classOf");
|
|
5
|
+
const ancestorOf_1 = require("./ancestorOf");
|
|
6
|
+
const nameOf_1 = require("./nameOf");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param target
|
|
10
|
+
* @returns {Array}
|
|
11
|
+
*/
|
|
12
|
+
function ancestorsOf(target) {
|
|
13
|
+
const classes = [];
|
|
14
|
+
let currentTarget = (0, classOf_1.classOf)(target);
|
|
15
|
+
while (currentTarget && (0, nameOf_1.nameOf)(currentTarget) !== "") {
|
|
16
|
+
classes.unshift(currentTarget);
|
|
17
|
+
currentTarget = (0, ancestorOf_1.getInheritedClass)(currentTarget);
|
|
18
|
+
}
|
|
19
|
+
return classes;
|
|
20
|
+
}
|
|
21
|
+
exports.ancestorsOf = ancestorsOf;
|
|
22
|
+
//# sourceMappingURL=ancestorsOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ancestorsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/ancestorsOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,6CAA+C;AAC/C,qCAAgC;AAEhC;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,aAAa,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,aAAa,IAAI,IAAA,eAAM,EAAC,aAAa,CAAC,KAAK,EAAE,EAAE;QACpD,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC/B,aAAa,GAAG,IAAA,8BAAiB,EAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,kCAWC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {getInheritedClass} from \"./ancestorOf\";\nimport {nameOf} from \"./nameOf\";\n\n/**\n *\n * @param target\n * @returns {Array}\n */\nexport function ancestorsOf(target: any) {\n const classes = [];\n\n let currentTarget = classOf(target);\n\n while (currentTarget && nameOf(currentTarget) !== \"\") {\n classes.unshift(currentTarget);\n currentTarget = getInheritedClass(currentTarget);\n }\n\n return classes;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classOf = exports.getClass = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get the provide constructor if target is an instance.
|
|
6
|
+
* @param target
|
|
7
|
+
* @returns {*}
|
|
8
|
+
*/
|
|
9
|
+
function getClass(target) {
|
|
10
|
+
return target.prototype ? target : target.constructor;
|
|
11
|
+
}
|
|
12
|
+
exports.getClass = getClass;
|
|
13
|
+
/**
|
|
14
|
+
* Get the provide constructor if target is an instance.
|
|
15
|
+
* @param target
|
|
16
|
+
* @returns {*}
|
|
17
|
+
* @alias getClass
|
|
18
|
+
*/
|
|
19
|
+
function classOf(target) {
|
|
20
|
+
return getClass(target);
|
|
21
|
+
}
|
|
22
|
+
exports.classOf = classOf;
|
|
23
|
+
//# sourceMappingURL=classOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/classOf.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,MAAW;IAClC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;AACxD,CAAC;AAFD,4BAEC;AAED;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,MAAW;IACjC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAFD,0BAEC","sourcesContent":["/**\n * Get the provide constructor if target is an instance.\n * @param target\n * @returns {*}\n */\nexport function getClass(target: any): any {\n return target.prototype ? target : target.constructor;\n}\n\n/**\n * Get the provide constructor if target is an instance.\n * @param target\n * @returns {*}\n * @alias getClass\n */\nexport function classOf(target: any) {\n return getClass(target);\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanObject = void 0;
|
|
4
|
+
const isProtectedKey_1 = require("./isProtectedKey");
|
|
5
|
+
/**
|
|
6
|
+
* Remove undefined value
|
|
7
|
+
* @param obj
|
|
8
|
+
* @param ignore
|
|
9
|
+
*/
|
|
10
|
+
function cleanObject(obj, ignore = []) {
|
|
11
|
+
return Object.entries(obj).reduce((obj, [key, value]) => {
|
|
12
|
+
if ((0, isProtectedKey_1.isProtectedKey)(key) || ignore.includes(key)) {
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
return value === undefined
|
|
16
|
+
? obj
|
|
17
|
+
: {
|
|
18
|
+
...obj,
|
|
19
|
+
[key]: value
|
|
20
|
+
};
|
|
21
|
+
}, {});
|
|
22
|
+
}
|
|
23
|
+
exports.cleanObject = cleanObject;
|
|
24
|
+
//# sourceMappingURL=cleanObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanObject.js","sourceRoot":"","sources":["../../../../src/utils/objects/cleanObject.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD;;;;GAIG;AACH,SAAgB,WAAW,CAAC,GAAQ,EAAE,SAAmB,EAAE;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtD,IAAI,IAAA,+BAAc,EAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC/C,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,GAAG;YACL,CAAC,CAAC;gBACE,GAAG,GAAG;gBACN,CAAC,GAAG,CAAC,EAAE,KAAK;aACb,CAAC;IACR,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAbD,kCAaC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n/**\n * Remove undefined value\n * @param obj\n * @param ignore\n */\nexport function cleanObject(obj: any, ignore: string[] = []): any {\n return Object.entries(obj).reduce((obj, [key, value]) => {\n if (isProtectedKey(key) || ignore.includes(key)) {\n return obj;\n }\n\n return value === undefined\n ? obj\n : {\n ...obj,\n [key]: value\n };\n }, {});\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructorOf = exports.getConstructor = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get the class constructor
|
|
6
|
+
* @param target
|
|
7
|
+
*/
|
|
8
|
+
function getConstructor(target) {
|
|
9
|
+
return typeof target === "function" ? target : target.constructor;
|
|
10
|
+
}
|
|
11
|
+
exports.getConstructor = getConstructor;
|
|
12
|
+
/**
|
|
13
|
+
* Get the class constructor
|
|
14
|
+
* @param target
|
|
15
|
+
*/
|
|
16
|
+
function constructorOf(target) {
|
|
17
|
+
return getConstructor(target);
|
|
18
|
+
}
|
|
19
|
+
exports.constructorOf = constructorOf;
|
|
20
|
+
//# sourceMappingURL=constructorOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/constructorOf.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAW;IACxC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;AACpE,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,sCAEC","sourcesContent":["import type {Type} from \"../../domain/Type\";\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function getConstructor(target: any): Type<any> {\n return typeof target === \"function\" ? target : target.constructor;\n}\n\n/**\n * Get the class constructor\n * @param target\n */\nexport function constructorOf(target: any): Type<any> {\n return getConstructor(target);\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInstance = void 0;
|
|
4
|
+
const classOf_1 = require("./classOf");
|
|
5
|
+
function createInstance(obj) {
|
|
6
|
+
return obj ? ((0, classOf_1.classOf)(obj) !== Object ? Object.create(obj) : {}) : {};
|
|
7
|
+
}
|
|
8
|
+
exports.createInstance = createInstance;
|
|
9
|
+
//# sourceMappingURL=createInstance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInstance.js","sourceRoot":"","sources":["../../../../src/utils/objects/createInstance.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,SAAgB,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC;AAFD,wCAEC","sourcesContent":["import {classOf} from \"./classOf\";\n\nexport function createInstance(obj: any) {\n return obj ? (classOf(obj) !== Object ? Object.create(obj) : {}) : {};\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepClone = void 0;
|
|
4
|
+
const isArray_1 = require("./isArray");
|
|
5
|
+
const isDate_1 = require("./isDate");
|
|
6
|
+
const isFunction_1 = require("./isFunction");
|
|
7
|
+
const isNil_1 = require("./isNil");
|
|
8
|
+
const isPrimitive_1 = require("./isPrimitive");
|
|
9
|
+
const isSymbol_1 = require("./isSymbol");
|
|
10
|
+
const isBasicType = (source) => (0, isNil_1.isNil)(source) || (0, isPrimitive_1.isPrimitive)(source) || (0, isSymbol_1.isSymbol)(source) || (0, isFunction_1.isFunction)(source);
|
|
11
|
+
/**
|
|
12
|
+
* Return a cloned value
|
|
13
|
+
* @param source
|
|
14
|
+
* @param stack
|
|
15
|
+
*/
|
|
16
|
+
function deepClone(source, stack = new WeakMap()) {
|
|
17
|
+
let dest;
|
|
18
|
+
if (isBasicType(source)) {
|
|
19
|
+
return source;
|
|
20
|
+
}
|
|
21
|
+
if ((0, isDate_1.isDate)(source)) {
|
|
22
|
+
return new Date(source);
|
|
23
|
+
}
|
|
24
|
+
const stacked = stack.get(source);
|
|
25
|
+
if (stacked) {
|
|
26
|
+
// See issue #1619
|
|
27
|
+
// istanbul ignore next
|
|
28
|
+
process.env.TSED_TRACK_CIRCULAR_REF && console.trace("Circular ref detected on deepClone", stacked);
|
|
29
|
+
return stacked;
|
|
30
|
+
}
|
|
31
|
+
if ((0, isArray_1.isArray)(source)) {
|
|
32
|
+
dest = [];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
dest = {};
|
|
36
|
+
stack.set(source, dest);
|
|
37
|
+
}
|
|
38
|
+
for (const key in source) {
|
|
39
|
+
// Use getOwnPropertyDescriptor instead of source[key] to prevent from triggering setter/getter.
|
|
40
|
+
const descriptor = Object.getOwnPropertyDescriptor(source, key);
|
|
41
|
+
if (descriptor) {
|
|
42
|
+
if (!(0, isFunction_1.isFunction)(descriptor.value)) {
|
|
43
|
+
dest[key] = deepClone(descriptor.value, stack);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
Object.defineProperty(dest, key, descriptor);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!(0, isArray_1.isArray)(source)) {
|
|
51
|
+
const prototype = Reflect.getPrototypeOf(source);
|
|
52
|
+
Reflect.setPrototypeOf(dest, prototype);
|
|
53
|
+
}
|
|
54
|
+
return dest;
|
|
55
|
+
}
|
|
56
|
+
exports.deepClone = deepClone;
|
|
57
|
+
//# sourceMappingURL=deepClone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepClone.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepClone.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,qCAAgC;AAChC,6CAAwC;AACxC,mCAA8B;AAC9B,+CAA0C;AAC1C,yCAAoC;AAEpC,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,IAAA,aAAK,EAAC,MAAM,CAAC,IAAI,IAAA,yBAAW,EAAC,MAAM,CAAC,IAAI,IAAA,mBAAQ,EAAC,MAAM,CAAC,IAAI,IAAA,uBAAU,EAAC,MAAM,CAAC,CAAC;AAEpH;;;;GAIG;AACH,SAAgB,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,IAAA,eAAM,EAAC,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,IAAA,iBAAO,EAAC,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,IAAA,uBAAU,EAAC,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,IAAA,iBAAO,EAAC,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;AA9CD,8BA8CC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepExtends = void 0;
|
|
4
|
+
const createInstance_1 = require("./createInstance");
|
|
5
|
+
const isArray_1 = require("./isArray");
|
|
6
|
+
const isPrimitive_1 = require("./isPrimitive");
|
|
7
|
+
const objectKeys_1 = require("./objectKeys");
|
|
8
|
+
function reducer() {
|
|
9
|
+
return (collection, value) => {
|
|
10
|
+
collection.indexOf(value) === -1 && collection.push(value);
|
|
11
|
+
return collection;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Deep extends a model with another one.
|
|
16
|
+
* @param out
|
|
17
|
+
* @param obj
|
|
18
|
+
* @param reducers
|
|
19
|
+
* @returns {any}
|
|
20
|
+
* @deprecated Since 2021-07-16. Use deepMerge instead of
|
|
21
|
+
*/
|
|
22
|
+
function deepExtends(out, obj, reducers = {}) {
|
|
23
|
+
if (obj === undefined || obj === null) {
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
if ((0, isPrimitive_1.isPrimitive)(obj) || typeof obj === "symbol" || typeof obj === "function") {
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
if ((0, isArray_1.isArrayOrArrayClass)(obj)) {
|
|
30
|
+
out = out || [];
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
out = out || (0, createInstance_1.createInstance)(obj);
|
|
34
|
+
}
|
|
35
|
+
const defaultReducer = reducers["default"] ? reducers["default"] : reducer();
|
|
36
|
+
const set = (key, value) => {
|
|
37
|
+
if ((0, isArray_1.isArrayOrArrayClass)(obj)) {
|
|
38
|
+
out.indexOf(value) === -1 && out.push(value);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
out[key] = value;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
(0, objectKeys_1.objectKeys)(obj).forEach((key) => {
|
|
45
|
+
let value = obj[key];
|
|
46
|
+
// istanbul ignore next
|
|
47
|
+
if (value === undefined || value === null) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// istanbul ignore next
|
|
51
|
+
if (value === "" && out[key] !== "") {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if ((0, isPrimitive_1.isPrimitive)(value) || typeof value === "function") {
|
|
55
|
+
set(key, value);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if ((0, isArray_1.isArrayOrArrayClass)(value)) {
|
|
59
|
+
value = value.map((value) => deepExtends(undefined, value));
|
|
60
|
+
set(key, []
|
|
61
|
+
.concat(out[key] || [], value)
|
|
62
|
+
.reduce((collection, value) => (reducers[key] ? reducers[key](collection, value) : defaultReducer(collection, value)), []));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Object
|
|
66
|
+
if ((0, isArray_1.isArrayOrArrayClass)(obj)) {
|
|
67
|
+
set(key, deepExtends(undefined, value, reducers));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
set(key, deepExtends(out[key], value, reducers));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if ((0, isArray_1.isArrayOrArrayClass)(out)) {
|
|
74
|
+
out.reduce((collection, value) => defaultReducer(collection, value), []);
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
exports.deepExtends = deepExtends;
|
|
79
|
+
//# sourceMappingURL=deepExtends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepExtends.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepExtends.ts"],"names":[],"mappings":"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","sourcesContent":["import {createInstance} from \"./createInstance\";\nimport {isArrayOrArrayClass} from \"./isArray\";\nimport {isPrimitive} from \"./isPrimitive\";\nimport {objectKeys} from \"./objectKeys\";\n\nexport type DeepExtendsReducers = Record<string, (collection: any[], value: any) => any>;\n\nfunction reducer() {\n return (collection: any[], value: any) => {\n collection.indexOf(value) === -1 && collection.push(value);\n\n return collection;\n };\n}\n\n/**\n * Deep extends a model with another one.\n * @param out\n * @param obj\n * @param reducers\n * @returns {any}\n * @deprecated Since 2021-07-16. Use deepMerge instead of\n */\nexport function deepExtends(out: any, obj: any, reducers: DeepExtendsReducers = {}): any {\n if (obj === undefined || obj === null) {\n return out;\n }\n\n if (isPrimitive(obj) || typeof obj === \"symbol\" || typeof obj === \"function\") {\n return obj;\n }\n\n if (isArrayOrArrayClass(obj)) {\n out = out || [];\n } else {\n out = out || createInstance(obj);\n }\n\n const defaultReducer = reducers[\"default\"] ? reducers[\"default\"] : reducer();\n\n const set = (key: string | number, value: any) => {\n if (isArrayOrArrayClass(obj)) {\n out.indexOf(value) === -1 && out.push(value);\n } else {\n out[key] = value;\n }\n };\n\n objectKeys(obj).forEach((key) => {\n let value = obj[key];\n\n // istanbul ignore next\n if (value === undefined || value === null) {\n return;\n }\n\n // istanbul ignore next\n if (value === \"\" && out[key] !== \"\") {\n return;\n }\n\n if (isPrimitive(value) || typeof value === \"function\") {\n set(key, value);\n\n return;\n }\n\n if (isArrayOrArrayClass(value)) {\n value = value.map((value: any) => deepExtends(undefined, value));\n\n set(\n key,\n []\n .concat(out[key] || [], value)\n .reduce(\n (collection: any[], value: any) => (reducers[key] ? reducers[key](collection, value) : defaultReducer(collection, value)),\n []\n )\n );\n\n return;\n }\n\n // Object\n if (isArrayOrArrayClass(obj)) {\n set(key, deepExtends(undefined, value, reducers));\n } else {\n set(key, deepExtends(out[key], value, reducers));\n }\n });\n\n if (isArrayOrArrayClass(out)) {\n out.reduce((collection: any[], value: any) => defaultReducer(collection, value), []);\n }\n\n return out;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepMerge = exports.mergeReducerBuilder = void 0;
|
|
4
|
+
const createInstance_1 = require("./createInstance");
|
|
5
|
+
const isFunction_1 = require("./isFunction");
|
|
6
|
+
const isPrimitive_1 = require("./isPrimitive");
|
|
7
|
+
const isSymbol_1 = require("./isSymbol");
|
|
8
|
+
const objectKeys_1 = require("./objectKeys");
|
|
9
|
+
function mergeReducerBuilder(cb) {
|
|
10
|
+
return (collection, value, options) => {
|
|
11
|
+
const index = collection.findIndex((item) => cb(item, value));
|
|
12
|
+
if (index === -1) {
|
|
13
|
+
return [...collection, value];
|
|
14
|
+
}
|
|
15
|
+
collection[index] = deepMerge(collection[index], value, options);
|
|
16
|
+
return collection;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.mergeReducerBuilder = mergeReducerBuilder;
|
|
20
|
+
const defaultReducer = mergeReducerBuilder((a, b) => a === b);
|
|
21
|
+
function getReducer({ reducers, parentKey }) {
|
|
22
|
+
if (!reducers) {
|
|
23
|
+
return defaultReducer;
|
|
24
|
+
}
|
|
25
|
+
if (parentKey && reducers[parentKey]) {
|
|
26
|
+
return reducers[parentKey];
|
|
27
|
+
}
|
|
28
|
+
return reducers["default"] || defaultReducer;
|
|
29
|
+
}
|
|
30
|
+
function shouldReturnObj(obj, source) {
|
|
31
|
+
return (0, isPrimitive_1.isPrimitive)(obj) || (0, isSymbol_1.isSymbol)(obj) || (0, isFunction_1.isFunction)(obj) || source === undefined;
|
|
32
|
+
}
|
|
33
|
+
function shouldReturnSource(obj, source) {
|
|
34
|
+
return obj === undefined || obj === null || (obj === "" && source !== "");
|
|
35
|
+
}
|
|
36
|
+
function deepMerge(source, obj, options = {}) {
|
|
37
|
+
if (shouldReturnSource(obj, source)) {
|
|
38
|
+
return source;
|
|
39
|
+
}
|
|
40
|
+
if (shouldReturnObj(obj, source)) {
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
if (Array.isArray(source)) {
|
|
44
|
+
const reducer = getReducer(options);
|
|
45
|
+
return [].concat(obj).reduce((out, value) => reducer(out, value, options), [...source]);
|
|
46
|
+
}
|
|
47
|
+
return [...(0, objectKeys_1.objectKeys)(source), ...(0, objectKeys_1.objectKeys)(obj)].reduce((out, key) => {
|
|
48
|
+
const src = source && source[key];
|
|
49
|
+
const value = deepMerge(src, obj && obj[key], {
|
|
50
|
+
...options,
|
|
51
|
+
parentKey: key
|
|
52
|
+
});
|
|
53
|
+
if (options.cleanUndefinedProps && value === undefined) {
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
...out,
|
|
58
|
+
[key]: value
|
|
59
|
+
};
|
|
60
|
+
}, (0, createInstance_1.createInstance)(source));
|
|
61
|
+
}
|
|
62
|
+
exports.deepMerge = deepMerge;
|
|
63
|
+
//# sourceMappingURL=deepMerge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../../../src/utils/objects/deepMerge.ts"],"names":[],"mappings":"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","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 extends any = any, C extends any = any>(\n source: T & any,\n obj: C & any,\n options: DeepMergeOptions = {}\n): (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"]}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMethodDescriptor = exports.descriptorOf = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Return the descriptor for a given class and propertyKey
|
|
6
|
+
* @param target
|
|
7
|
+
* @param {string} propertyKey
|
|
8
|
+
* @returns {PropertyDescriptor}
|
|
9
|
+
*/
|
|
10
|
+
function descriptorOf(target, propertyKey) {
|
|
11
|
+
return Object.getOwnPropertyDescriptor((target && target.prototype) || target, propertyKey);
|
|
12
|
+
}
|
|
13
|
+
exports.descriptorOf = descriptorOf;
|
|
14
|
+
function isMethodDescriptor(target, propertyKey) {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = descriptorOf(target, propertyKey)) === null || _a === void 0 ? void 0 : _a.value;
|
|
17
|
+
}
|
|
18
|
+
exports.isMethodDescriptor = isMethodDescriptor;
|
|
19
|
+
//# sourceMappingURL=descriptorOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/descriptorOf.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,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;AAFD,oCAEC;AAED,SAAgB,kBAAkB,CAAC,MAAW,EAAE,WAA4B;;IAC1E,OAAO,MAAA,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,0CAAE,KAAK,CAAC;AAClD,CAAC;AAFD,gDAEC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClassOrSymbol = void 0;
|
|
4
|
+
const classOf_1 = require("./classOf");
|
|
5
|
+
const isClass_1 = require("./isClass");
|
|
6
|
+
function getClassOrSymbol(target) {
|
|
7
|
+
return (0, isClass_1.isClass)(target) ? (0, classOf_1.classOf)(target) : target;
|
|
8
|
+
}
|
|
9
|
+
exports.getClassOrSymbol = getClassOrSymbol;
|
|
10
|
+
//# sourceMappingURL=getClassOrSymbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getClassOrSymbol.js","sourceRoot":"","sources":["../../../../src/utils/objects/getClassOrSymbol.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,uCAAkC;AAElC,SAAgB,gBAAgB,CAAC,MAAW;IAC1C,OAAO,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAFD,4CAEC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {isClass} from \"./isClass\";\n\nexport function getClassOrSymbol(target: any): any {\n return isClass(target) ? classOf(target) : target;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConstructorArgNames = void 0;
|
|
4
|
+
const toStringConstructor_1 = require("./toStringConstructor");
|
|
5
|
+
function getConstructorArgNames(target) {
|
|
6
|
+
return (0, toStringConstructor_1.toStringConstructor)(target).replace("constructor(", "").replace(")", "").split(", ").filter(Boolean);
|
|
7
|
+
}
|
|
8
|
+
exports.getConstructorArgNames = getConstructorArgNames;
|
|
9
|
+
//# sourceMappingURL=getConstructorArgNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,SAAgB,sBAAsB,CAAC,MAAW;IAChD,OAAO,IAAA,yCAAmB,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC9G,CAAC;AAFD,wDAEC","sourcesContent":["import {toStringConstructor} from \"./toStringConstructor\";\n\nexport function getConstructorArgNames(target: any) {\n return toStringConstructor(target).replace(\"constructor(\", \"\").replace(\")\", \"\").split(\", \").filter(Boolean);\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnumerableKeys = void 0;
|
|
4
|
+
const isEnumerable_1 = require("./isEnumerable");
|
|
5
|
+
const isProtectedKey_1 = require("./isProtectedKey");
|
|
6
|
+
/**
|
|
7
|
+
* Return all enumerable keys of the given object
|
|
8
|
+
* @param obj
|
|
9
|
+
*/
|
|
10
|
+
function getEnumerableKeys(obj) {
|
|
11
|
+
const keys = [];
|
|
12
|
+
for (const key in obj) {
|
|
13
|
+
if (!(0, isProtectedKey_1.isProtectedKey)(key) && (0, isEnumerable_1.isEnumerable)(obj, key)) {
|
|
14
|
+
keys.push(key);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return keys;
|
|
18
|
+
}
|
|
19
|
+
exports.getEnumerableKeys = getEnumerableKeys;
|
|
20
|
+
//# sourceMappingURL=getEnumerableKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEnumerableKeys.js","sourceRoot":"","sources":["../../../../src/utils/objects/getEnumerableKeys.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,qDAAgD;AAEhD;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,IAAI,CAAC,IAAA,+BAAc,EAAC,GAAG,CAAC,IAAI,IAAA,2BAAY,EAAC,GAAG,EAAE,GAAG,CAAC,EAAE;YAClD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAChB;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAVD,8CAUC","sourcesContent":["import {isEnumerable} from \"./isEnumerable\";\nimport {isProtectedKey} from \"./isProtectedKey\";\n\n/**\n * Return all enumerable keys of the given object\n * @param obj\n */\nexport function getEnumerableKeys(obj: any) {\n const keys: string[] = [];\n\n for (const key in obj) {\n if (!isProtectedKey(key) && isEnumerable(obj, key)) {\n keys.push(key);\n }\n }\n\n return keys;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValue = void 0;
|
|
4
|
+
const isFunction_1 = require("./isFunction");
|
|
5
|
+
const isObject_1 = require("./isObject");
|
|
6
|
+
const isString_1 = require("./isString");
|
|
7
|
+
const mapOptions = (args) => {
|
|
8
|
+
const [expression, scope, defaultValue, separator = "."] = args;
|
|
9
|
+
if ((0, isObject_1.isObject)(scope) || (0, isString_1.isString)(expression)) {
|
|
10
|
+
return {
|
|
11
|
+
expression,
|
|
12
|
+
scope,
|
|
13
|
+
defaultValue,
|
|
14
|
+
separator
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
expression: scope,
|
|
19
|
+
scope: expression,
|
|
20
|
+
defaultValue,
|
|
21
|
+
separator
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
function getValue(...args) {
|
|
25
|
+
const options = mapOptions(args);
|
|
26
|
+
let scope = options.scope;
|
|
27
|
+
const { expression, defaultValue, separator } = options;
|
|
28
|
+
if (!expression) {
|
|
29
|
+
return scope;
|
|
30
|
+
}
|
|
31
|
+
if (!scope) {
|
|
32
|
+
return defaultValue;
|
|
33
|
+
}
|
|
34
|
+
const keys = expression.split(separator);
|
|
35
|
+
const getValue = (key) => {
|
|
36
|
+
if (scope) {
|
|
37
|
+
if (scope[key] !== undefined || key in scope) {
|
|
38
|
+
return scope[key];
|
|
39
|
+
}
|
|
40
|
+
if ((0, isFunction_1.isFunction)(scope.get)) {
|
|
41
|
+
return scope.get(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
while ((scope = getValue(keys.shift())) && keys.length) { }
|
|
46
|
+
return scope === undefined ? defaultValue : scope;
|
|
47
|
+
}
|
|
48
|
+
exports.getValue = getValue;
|
|
49
|
+
//# sourceMappingURL=getValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/getValue.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,yCAAoC;AACpC,yCAAoC;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,IAAA,mBAAQ,EAAC,KAAK,CAAC,IAAI,IAAA,mBAAQ,EAAC,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,SAAgB,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,EAAE;YACT,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,GAAG,IAAI,KAAK,EAAE;gBAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YAED,IAAI,IAAA,uBAAU,EAAC,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;AA9BD,4BA8BC","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 || 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"]}
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./ancestorOf"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./ancestorsOf"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./classOf"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./cleanObject"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./constructorOf"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./deepClone"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./deepExtends"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./deepMerge"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./getClassOrSymbol"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./getConstructorArgNames"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./getEnumerableKeys"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./ancestorOf"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./getValue"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./isArray"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./isArrowFn"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./isBoolean"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./isClass"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./isCollection"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./isDate"), exports);
|
|
23
|
+
(0, tslib_1.__exportStar)(require("./isEmpty"), exports);
|
|
24
|
+
(0, tslib_1.__exportStar)(require("./isEnumerable"), exports);
|
|
25
|
+
(0, tslib_1.__exportStar)(require("./isFunction"), exports);
|
|
26
|
+
(0, tslib_1.__exportStar)(require("./isInheritedFrom"), exports);
|
|
27
|
+
(0, tslib_1.__exportStar)(require("./isNil"), exports);
|
|
28
|
+
(0, tslib_1.__exportStar)(require("./isNumber"), exports);
|
|
29
|
+
(0, tslib_1.__exportStar)(require("./isObject"), exports);
|
|
30
|
+
(0, tslib_1.__exportStar)(require("./isObservable"), exports);
|
|
31
|
+
(0, tslib_1.__exportStar)(require("./isPlainObject"), exports);
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./isPrimitive"), exports);
|
|
33
|
+
(0, tslib_1.__exportStar)(require("./isPromise"), exports);
|
|
34
|
+
(0, tslib_1.__exportStar)(require("./isProtectedKey"), exports);
|
|
35
|
+
(0, tslib_1.__exportStar)(require("./isStream"), exports);
|
|
36
|
+
(0, tslib_1.__exportStar)(require("./isString"), exports);
|
|
37
|
+
(0, tslib_1.__exportStar)(require("./isSymbol"), exports);
|
|
38
|
+
(0, tslib_1.__exportStar)(require("./isSerializable"), exports);
|
|
39
|
+
(0, tslib_1.__exportStar)(require("./methodsOf"), exports);
|
|
40
|
+
(0, tslib_1.__exportStar)(require("./nameOf"), exports);
|
|
41
|
+
(0, tslib_1.__exportStar)(require("./objectKeys"), exports);
|
|
42
|
+
(0, tslib_1.__exportStar)(require("./primitiveOf"), exports);
|
|
43
|
+
(0, tslib_1.__exportStar)(require("./prototypeOf"), exports);
|
|
44
|
+
(0, tslib_1.__exportStar)(require("./setValue"), exports);
|
|
45
|
+
(0, tslib_1.__exportStar)(require("./toMap"), exports);
|
|
46
|
+
(0, tslib_1.__exportStar)(require("./toStringConstructor"), exports);
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/objects/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,6DAA8B;AAC9B,yDAA0B;AAC1B,6DAA8B;AAC9B,+DAAgC;AAChC,2DAA4B;AAC5B,6DAA8B;AAC9B,2DAA4B;AAC5B,kEAAmC;AACnC,wEAAyC;AACzC,mEAAoC;AACpC,4DAA6B;AAC7B,0DAA2B;AAC3B,yDAA0B;AAC1B,2DAA4B;AAC5B,2DAA4B;AAC5B,yDAA0B;AAC1B,8DAA+B;AAC/B,wDAAyB;AACzB,yDAA0B;AAC1B,8DAA+B;AAC/B,4DAA6B;AAC7B,iEAAkC;AAClC,uDAAwB;AACxB,0DAA2B;AAC3B,0DAA2B;AAC3B,8DAA+B;AAC/B,+DAAgC;AAChC,6DAA8B;AAC9B,2DAA4B;AAC5B,gEAAiC;AACjC,0DAA2B;AAC3B,0DAA2B;AAC3B,0DAA2B;AAC3B,gEAAiC;AACjC,2DAA4B;AAC5B,wDAAyB;AACzB,4DAA6B;AAC7B,6DAA8B;AAC9B,6DAA8B;AAC9B,0DAA2B;AAC3B,uDAAwB;AACxB,qEAAsC","sourcesContent":["export * from \"./ancestorOf\";\nexport * from \"./ancestorsOf\";\nexport * from \"./classOf\";\nexport * from \"./cleanObject\";\nexport * from \"./constructorOf\";\nexport * from \"./deepClone\";\nexport * from \"./deepExtends\";\nexport * from \"./deepMerge\";\nexport * from \"./getClassOrSymbol\";\nexport * from \"./getConstructorArgNames\";\nexport * from \"./getEnumerableKeys\";\nexport * from \"./ancestorOf\";\nexport * from \"./getValue\";\nexport * from \"./isArray\";\nexport * from \"./isArrowFn\";\nexport * from \"./isBoolean\";\nexport * from \"./isClass\";\nexport * from \"./isCollection\";\nexport * from \"./isDate\";\nexport * from \"./isEmpty\";\nexport * from \"./isEnumerable\";\nexport * from \"./isFunction\";\nexport * from \"./isInheritedFrom\";\nexport * from \"./isNil\";\nexport * from \"./isNumber\";\nexport * from \"./isObject\";\nexport * from \"./isObservable\";\nexport * from \"./isPlainObject\";\nexport * from \"./isPrimitive\";\nexport * from \"./isPromise\";\nexport * from \"./isProtectedKey\";\nexport * from \"./isStream\";\nexport * from \"./isString\";\nexport * from \"./isSymbol\";\nexport * from \"./isSerializable\";\nexport * from \"./methodsOf\";\nexport * from \"./nameOf\";\nexport * from \"./objectKeys\";\nexport * from \"./primitiveOf\";\nexport * from \"./prototypeOf\";\nexport * from \"./setValue\";\nexport * from \"./toMap\";\nexport * from \"./toStringConstructor\";\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isArrayOrArrayClass = exports.isArray = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Return true if value is an array
|
|
6
|
+
* @param target
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
function isArray(target) {
|
|
10
|
+
return Array.isArray(target);
|
|
11
|
+
}
|
|
12
|
+
exports.isArray = isArray;
|
|
13
|
+
/**
|
|
14
|
+
* Return true if the clazz is an array.
|
|
15
|
+
* @param target
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
function isArrayOrArrayClass(target) {
|
|
20
|
+
return target === Array || isArray(target);
|
|
21
|
+
}
|
|
22
|
+
exports.isArrayOrArrayClass = isArrayOrArrayClass;
|
|
23
|
+
//# sourceMappingURL=isArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isArray.js","sourceRoot":"","sources":["../../../../src/utils/objects/isArray.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,OAAO,CAAU,MAAe;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAFD,0BAEC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAU,MAAe;IAC1D,OAAO,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAFD,kDAEC","sourcesContent":["/**\n * Return true if value is an array\n * @param target\n * @returns {boolean}\n */\nexport function isArray<T = any>(target: unknown): target is T[] {\n return Array.isArray(target);\n}\n\n/**\n * Return true if the clazz is an array.\n * @param target\n * @returns {boolean}\n * @ignore\n */\nexport function isArrayOrArrayClass<T = any>(target: unknown): target is T[] {\n return target === Array || isArray(target);\n}\n"]}
|
|
File without changes
|