@tsed/core 7.0.0-alpha.1 → 7.0.0-beta.3
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/cjs/decorators/configurable.js +18 -0
- package/lib/cjs/decorators/configurable.js.map +1 -0
- package/lib/cjs/decorators/deprecated.js +43 -0
- package/lib/cjs/decorators/deprecated.js.map +1 -0
- package/lib/cjs/decorators/enumerable.js +18 -0
- package/lib/cjs/decorators/enumerable.js.map +1 -0
- package/lib/cjs/decorators/index.js +18 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/cjs/decorators/notConfigurable.js +13 -0
- package/lib/cjs/decorators/notConfigurable.js.map +1 -0
- package/lib/cjs/decorators/notEnumerable.js +13 -0
- package/lib/cjs/decorators/notEnumerable.js.map +1 -0
- package/lib/cjs/decorators/readOnly.js +13 -0
- package/lib/cjs/decorators/readOnly.js.map +1 -0
- package/lib/cjs/decorators/storeFn.js +22 -0
- package/lib/cjs/decorators/storeFn.js.map +1 -0
- package/lib/cjs/decorators/storeMerge.js +11 -0
- package/lib/cjs/decorators/storeMerge.js.map +1 -0
- package/lib/cjs/decorators/storeSet.js +11 -0
- package/lib/cjs/decorators/storeSet.js.map +1 -0
- package/lib/cjs/decorators/writable.js +18 -0
- package/lib/cjs/decorators/writable.js.map +1 -0
- package/lib/cjs/domain/AnyToPromise.js +148 -0
- package/lib/cjs/domain/AnyToPromise.js.map +1 -0
- package/lib/cjs/domain/DecoratorTypes.js +15 -0
- package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
- package/lib/cjs/domain/Env.js +19 -0
- package/lib/cjs/domain/Env.js.map +1 -0
- package/lib/cjs/domain/Hooks.js +89 -0
- package/lib/cjs/domain/Hooks.js.map +1 -0
- package/lib/cjs/domain/Metadata.js +508 -0
- package/lib/cjs/domain/Metadata.js.map +1 -0
- package/lib/cjs/domain/Store.js +157 -0
- package/lib/cjs/domain/Store.js.map +1 -0
- package/lib/cjs/domain/Type.js +7 -0
- package/lib/cjs/domain/Type.js.map +1 -0
- package/lib/cjs/domain/index.js +11 -0
- package/lib/cjs/domain/index.js.map +1 -0
- package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
- package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
- package/lib/cjs/index.js +9 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/interfaces/AnyDecorator.js +3 -0
- package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
- package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
- package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
- package/lib/cjs/interfaces/HashOf.js +3 -0
- package/lib/cjs/interfaces/HashOf.js.map +1 -0
- package/lib/cjs/interfaces/MetadataTypes.js +3 -0
- package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
- package/lib/cjs/interfaces/ValueOf.js +3 -0
- package/lib/cjs/interfaces/ValueOf.js.map +1 -0
- package/lib/cjs/interfaces/index.js +3 -0
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/cjs/utils/catchError.js +22 -0
- package/lib/cjs/utils/catchError.js.map +1 -0
- package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
- package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
- package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
- package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
- package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
- package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
- package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
- package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
- package/lib/cjs/utils/decorators/useDecorators.js +14 -0
- package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
- package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
- package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
- package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
- package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
- package/lib/cjs/utils/imports/importPackage.js +35 -0
- package/lib/cjs/utils/imports/importPackage.js.map +1 -0
- package/lib/cjs/utils/index.js +19 -0
- package/lib/cjs/utils/index.js.map +1 -0
- package/lib/cjs/utils/objects/ancestorOf.js +12 -0
- package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
- package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
- package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
- package/lib/cjs/utils/objects/classOf.js +23 -0
- package/lib/cjs/utils/objects/classOf.js.map +1 -0
- package/lib/cjs/utils/objects/cleanObject.js +24 -0
- package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
- package/lib/cjs/utils/objects/constructorOf.js +20 -0
- package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
- package/lib/cjs/utils/objects/createInstance.js +9 -0
- package/lib/cjs/utils/objects/createInstance.js.map +1 -0
- package/lib/cjs/utils/objects/deepClone.js +57 -0
- package/lib/cjs/utils/objects/deepClone.js.map +1 -0
- package/lib/cjs/utils/objects/deepMerge.js +63 -0
- package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
- package/lib/cjs/utils/objects/descriptorOf.js +19 -0
- package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
- package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
- package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
- package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
- package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
- package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
- package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
- package/lib/cjs/utils/objects/getValue.js +49 -0
- package/lib/cjs/utils/objects/getValue.js.map +1 -0
- package/lib/cjs/utils/objects/index.js +46 -0
- package/lib/cjs/utils/objects/index.js.map +1 -0
- package/lib/cjs/utils/objects/isArray.js +23 -0
- package/lib/cjs/utils/objects/isArray.js.map +1 -0
- package/lib/cjs/utils/objects/isArrowFn.js +9 -0
- package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
- package/lib/cjs/utils/objects/isBoolean.js +17 -0
- package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
- package/lib/cjs/utils/objects/isClass.js +26 -0
- package/lib/cjs/utils/objects/isClass.js.map +1 -0
- package/lib/cjs/utils/objects/isCollection.js +22 -0
- package/lib/cjs/utils/objects/isCollection.js.map +1 -0
- package/lib/cjs/utils/objects/isDate.js +13 -0
- package/lib/cjs/utils/objects/isDate.js.map +1 -0
- package/lib/cjs/utils/objects/isEmpty.js +14 -0
- package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
- package/lib/cjs/utils/objects/isEnumerable.js +22 -0
- package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
- package/lib/cjs/utils/objects/isFunction.js +8 -0
- package/lib/cjs/utils/objects/isFunction.js.map +1 -0
- package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
- package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
- package/lib/cjs/utils/objects/isNil.js +8 -0
- package/lib/cjs/utils/objects/isNil.js.map +1 -0
- package/lib/cjs/utils/objects/isNumber.js +17 -0
- package/lib/cjs/utils/objects/isNumber.js.map +1 -0
- package/lib/cjs/utils/objects/isObject.js +8 -0
- package/lib/cjs/utils/objects/isObject.js.map +1 -0
- package/lib/cjs/utils/objects/isObservable.js +8 -0
- package/lib/cjs/utils/objects/isObservable.js.map +1 -0
- package/lib/cjs/utils/objects/isPlainObject.js +18 -0
- package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
- package/lib/cjs/utils/objects/isPrimitive.js +30 -0
- package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
- package/lib/cjs/utils/objects/isPromise.js +16 -0
- package/lib/cjs/utils/objects/isPromise.js.map +1 -0
- package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
- package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
- package/lib/cjs/utils/objects/isSerializable.js +13 -0
- package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
- package/lib/cjs/utils/objects/isStream.js +8 -0
- package/lib/cjs/utils/objects/isStream.js.map +1 -0
- package/lib/cjs/utils/objects/isString.js +16 -0
- package/lib/cjs/utils/objects/isString.js.map +1 -0
- package/lib/cjs/utils/objects/isSymbol.js +16 -0
- package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
- package/lib/cjs/utils/objects/methodsOf.js +25 -0
- package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
- package/lib/cjs/utils/objects/nameOf.js +32 -0
- package/lib/cjs/utils/objects/nameOf.js.map +1 -0
- package/lib/cjs/utils/objects/objectKeys.js +9 -0
- package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
- package/lib/cjs/utils/objects/primitiveOf.js +20 -0
- package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
- package/lib/cjs/utils/objects/prototypeOf.js +14 -0
- package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
- package/lib/cjs/utils/objects/setValue.js +34 -0
- package/lib/cjs/utils/objects/setValue.js.map +1 -0
- package/lib/cjs/utils/objects/toMap.js +32 -0
- package/lib/cjs/utils/objects/toMap.js.map +1 -0
- package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
- package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
- package/lib/cjs/utils/proxyDelegation.js +54 -0
- package/lib/cjs/utils/proxyDelegation.js.map +1 -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/http/getHostInfoFromPort.js +17 -0
- package/lib/esm/utils/http/getHostInfoFromPort.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 +16 -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/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 +43 -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/{decorators → types/decorators}/configurable.d.ts +0 -0
- package/lib/{decorators → types/decorators}/deprecated.d.ts +0 -0
- package/lib/{decorators → types/decorators}/enumerable.d.ts +0 -0
- package/lib/{decorators → types/decorators}/index.d.ts +0 -0
- package/lib/{decorators → types/decorators}/notConfigurable.d.ts +0 -0
- package/lib/{decorators → types/decorators}/notEnumerable.d.ts +0 -0
- package/lib/{decorators → types/decorators}/readOnly.d.ts +0 -0
- package/lib/{decorators → types/decorators}/storeFn.d.ts +0 -0
- package/lib/{decorators → types/decorators}/storeMerge.d.ts +0 -0
- package/lib/{decorators → types/decorators}/storeSet.d.ts +0 -0
- package/lib/{decorators → types/decorators}/writable.d.ts +0 -0
- package/lib/{domain → types/domain}/AnyToPromise.d.ts +0 -0
- package/lib/{domain → types/domain}/DecoratorTypes.d.ts +0 -0
- package/lib/{domain → types/domain}/Env.d.ts +0 -0
- package/lib/{domain → types/domain}/Hooks.d.ts +0 -0
- package/lib/{domain → types/domain}/Metadata.d.ts +0 -0
- package/lib/{domain → types/domain}/Store.d.ts +5 -1
- package/lib/{domain → types/domain}/Type.d.ts +0 -0
- package/lib/{domain → types/domain}/index.d.ts +0 -1
- package/lib/{errors → types/errors}/UnsupportedDecoratorType.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +0 -0
- package/lib/{interfaces → types/interfaces}/AnyDecorator.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/DecoratorParameters.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/HashOf.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/MetadataTypes.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/ValueOf.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
- package/lib/{utils → types/utils}/catchError.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/decorateMethodsOf.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/decoratorArgs.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/decoratorTypeOf.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/useDecorators.d.ts +0 -0
- package/lib/{utils → types/utils}/decorators/useMethodDecorators.d.ts +0 -0
- package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
- package/lib/types/utils/imports/importPackage.d.ts +1 -0
- package/lib/{utils → types/utils}/index.d.ts +2 -0
- package/lib/{utils/objects/getInheritedClass.d.ts → types/utils/objects/ancestorOf.d.ts} +1 -0
- package/lib/{utils/objects/ancestorOf.d.ts → types/utils/objects/ancestorsOf.d.ts} +0 -0
- package/lib/{utils → types/utils}/objects/classOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/cleanObject.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/constructorOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/createInstance.d.ts +0 -0
- package/lib/types/utils/objects/deepClone.d.ts +6 -0
- package/lib/{utils → types/utils}/objects/deepMerge.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/descriptorOf.d.ts +1 -0
- package/lib/{utils → types/utils}/objects/getClassOrSymbol.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/getConstructorArgNames.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/getEnumerableKeys.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/getValue.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/index.d.ts +3 -1
- package/lib/{utils → types/utils}/objects/isArray.d.ts +0 -0
- package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
- package/lib/{utils → types/utils}/objects/isBoolean.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isClass.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isCollection.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isDate.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isEmpty.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isEnumerable.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isFunction.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isInheritedFrom.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isNil.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isNumber.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isObject.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isObservable.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isPlainObject.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isPrimitive.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isPromise.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isProtectedKey.d.ts +0 -0
- package/lib/types/utils/objects/isSerializable.d.ts +1 -0
- package/lib/{utils → types/utils}/objects/isStream.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isString.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/isSymbol.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/methodsOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/nameOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/objectKeys.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/primitiveOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/prototypeOf.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/setValue.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/toMap.d.ts +0 -0
- package/lib/{utils → types/utils}/objects/toStringConstructor.d.ts +0 -0
- package/lib/{utils → types/utils}/proxyDelegation.d.ts +0 -0
- package/lib/{utils → types/utils}/uniq.d.ts +0 -0
- package/package.json +11 -7
- package/tsconfig.compile.esm.json +23 -0
- package/lib/domain/Entity.d.ts +0 -97
- package/lib/index.js +0 -2271
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -2185
- package/lib/index.modern.js.map +0 -1
- package/lib/utils/objects/deepClone.d.ts +0 -5
- package/lib/utils/objects/isArrowFn.d.ts +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests to see if the object is an ES2015 (ES6) Promise
|
|
3
|
+
* @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}
|
|
4
|
+
* @param target
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/
|
|
7
|
+
export function isPromise(target) {
|
|
8
|
+
return (target === Promise ||
|
|
9
|
+
target instanceof Promise ||
|
|
10
|
+
(!!target && typeof target.subscribe !== "function" && typeof target.then === "function"));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=isPromise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPromise.js","sourceRoot":"","sources":["../../../../src/utils/objects/isPromise.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAU,MAAW;IAC5C,OAAO,CACL,MAAM,KAAK,OAAO;QAClB,MAAM,YAAY,OAAO;QACzB,CAAC,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAC1F,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Tests to see if the object is an ES2015 (ES6) Promise\n * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}\n * @param target\n * @returns {boolean}\n */\nexport function isPromise<T = any>(target: any): target is Promise<T> {\n return (\n target === Promise ||\n target instanceof Promise ||\n (!!target && typeof target.subscribe !== \"function\" && typeof target.then === \"function\")\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isProtectedKey.js","sourceRoot":"","sources":["../../../../src/utils/objects/isProtectedKey.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC","sourcesContent":["/**\n * Prevent prototype pollution vulnerability\n * @param key\n */\nexport function isProtectedKey(key: string) {\n return [\"__proto__\", \"constructor\", \"prototype\"].includes(key);\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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";
|
|
6
|
+
export function isSerializable(data) {
|
|
7
|
+
return !(Buffer.isBuffer(data) || isStream(data) || isBoolean(data) || isNumber(data) || isString(data) || isNil(data));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=isSerializable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSerializable.js","sourceRoot":"","sources":["../../../../src/utils/objects/isSerializable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,MAAM,UAAU,cAAc,CAAC,IAAS;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1H,CAAC","sourcesContent":["import {isStream} from \"./isStream\";\nimport {isBoolean} from \"./isBoolean\";\nimport {isNumber} from \"./isNumber\";\nimport {isString} from \"./isString\";\nimport {isNil} from \"./isNil\";\n\nexport function isSerializable(data: any) {\n return !(Buffer.isBuffer(data) || isStream(data) || isBoolean(data) || isNumber(data) || isString(data) || isNil(data));\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isStream.js","sourceRoot":"","sources":["../../../../src/utils/objects/isStream.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,GAAQ;IAC/B,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC;AACnF,CAAC","sourcesContent":["export function isStream(obj: any): boolean {\n return obj !== null && typeof obj === \"object\" && typeof obj.pipe === \"function\";\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param target
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/
|
|
5
|
+
export function isString(target) {
|
|
6
|
+
return typeof target === "string";
|
|
7
|
+
}
|
|
8
|
+
export function isStringOrStringClass(target) {
|
|
9
|
+
return typeof target === "string" || target instanceof String || target === String;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=isString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isString.js","sourceRoot":"","sources":["../../../../src/utils/objects/isString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAW;IAC/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC;AACrF,CAAC","sourcesContent":["/**\n * @param target\n * @returns {boolean}\n */\nexport function isString(target: any): target is string {\n return typeof target === \"string\";\n}\n\nexport function isStringOrStringClass(target: any): target is string {\n return typeof target === \"string\" || target instanceof String || target === String;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param target
|
|
4
|
+
*/
|
|
5
|
+
export function isSymbol(target) {
|
|
6
|
+
return typeof target === "symbol";
|
|
7
|
+
}
|
|
8
|
+
export function isSymbolOrSymbolClass(target) {
|
|
9
|
+
return typeof target === "symbol" || target instanceof Symbol || target === Symbol;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=isSymbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSymbol.js","sourceRoot":"","sources":["../../../../src/utils/objects/isSymbol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAW;IAClC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAW;IAC/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC;AACrF,CAAC","sourcesContent":["/**\n *\n * @param target\n */\nexport function isSymbol(target: any): target is symbol {\n return typeof target === \"symbol\";\n}\n\nexport function isSymbolOrSymbolClass(target: any): target is symbol {\n return typeof target === \"symbol\" || target instanceof Symbol || target === Symbol;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { classOf } from "./classOf";
|
|
2
|
+
import { ancestorsOf } from "./ancestorsOf";
|
|
3
|
+
import { prototypeOf } from "./prototypeOf";
|
|
4
|
+
/**
|
|
5
|
+
* Return all methods for a given class.
|
|
6
|
+
* @param target
|
|
7
|
+
*/
|
|
8
|
+
export function methodsOf(target) {
|
|
9
|
+
const methods = new Map();
|
|
10
|
+
target = classOf(target);
|
|
11
|
+
ancestorsOf(target).forEach((target) => {
|
|
12
|
+
const keys = Reflect.ownKeys(prototypeOf(target));
|
|
13
|
+
keys.forEach((propertyKey) => {
|
|
14
|
+
if (propertyKey !== "constructor") {
|
|
15
|
+
methods.set(propertyKey, { target, propertyKey });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return Array.from(methods.values());
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=methodsOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methodsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/methodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAW;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,CAAC,WAAmB,EAAE,EAAE;YACnC,IAAI,WAAW,KAAK,aAAa,EAAE;gBACjC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC;aACjD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {ancestorsOf} from \"./ancestorsOf\";\nimport {prototypeOf} from \"./prototypeOf\";\n\n/**\n * Return all methods for a given class.\n * @param target\n */\nexport function methodsOf(target: any) {\n const methods = new Map();\n target = classOf(target);\n\n ancestorsOf(target).forEach((target) => {\n const keys = Reflect.ownKeys(prototypeOf(target));\n\n keys.forEach((propertyKey: string) => {\n if (propertyKey !== \"constructor\") {\n methods.set(propertyKey, {target, propertyKey});\n }\n });\n });\n\n return Array.from(methods.values());\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the provide name.
|
|
3
|
+
* @param targetClass
|
|
4
|
+
*/
|
|
5
|
+
export function nameOfClass(targetClass) {
|
|
6
|
+
return typeof targetClass === "function" ? targetClass.name : targetClass.constructor.name;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get symbol name.
|
|
10
|
+
* @param sym
|
|
11
|
+
*/
|
|
12
|
+
export const nameOfSymbol = (sym) => sym.toString().replace("Symbol(", "").replace(")", "");
|
|
13
|
+
/**
|
|
14
|
+
* Get object name
|
|
15
|
+
*/
|
|
16
|
+
export function nameOf(obj) {
|
|
17
|
+
switch (typeof obj) {
|
|
18
|
+
default:
|
|
19
|
+
return "" + obj;
|
|
20
|
+
case "symbol":
|
|
21
|
+
return nameOfSymbol(obj);
|
|
22
|
+
case "function":
|
|
23
|
+
return nameOfClass(obj);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=nameOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nameOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/nameOf.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB;IAC1C,OAAO,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC;AAC7F,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAE5G;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,GAAQ;IAC7B,QAAQ,OAAO,GAAG,EAAE;QAClB;YACE,OAAO,EAAE,GAAG,GAAG,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;KAC3B;AACH,CAAC","sourcesContent":["/**\n * Get the provide name.\n * @param targetClass\n */\nexport function nameOfClass(targetClass: any): string {\n return typeof targetClass === \"function\" ? targetClass.name : targetClass.constructor.name;\n}\n\n/**\n * Get symbol name.\n * @param sym\n */\nexport const nameOfSymbol = (sym: symbol): string => sym.toString().replace(\"Symbol(\", \"\").replace(\")\", \"\");\n\n/**\n * Get object name\n */\nexport function nameOf(obj: any): string {\n switch (typeof obj) {\n default:\n return \"\" + obj;\n case \"symbol\":\n return nameOfSymbol(obj);\n case \"function\":\n return nameOfClass(obj);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectKeys.js","sourceRoot":"","sources":["../../../../src/utils/objects/objectKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,UAAU,CAAC,GAAQ;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n\nexport function objectKeys(obj: any): string[] {\n return Object.keys(obj).filter((key) => !isProtectedKey(key));\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isBooleanOrBooleanClass } from "./isBoolean";
|
|
2
|
+
import { isNumberOrNumberClass } from "./isNumber";
|
|
3
|
+
import { isStringOrStringClass } from "./isString";
|
|
4
|
+
export function primitiveOf(target) {
|
|
5
|
+
if (isStringOrStringClass(target)) {
|
|
6
|
+
return "string";
|
|
7
|
+
}
|
|
8
|
+
if (isNumberOrNumberClass(target)) {
|
|
9
|
+
return "number";
|
|
10
|
+
}
|
|
11
|
+
if (isBooleanOrBooleanClass(target)) {
|
|
12
|
+
return "boolean";
|
|
13
|
+
}
|
|
14
|
+
return "any";
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=primitiveOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitiveOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/primitiveOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,uBAAuB,EAAC,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAW,qBAAqB,EAAC,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAW,qBAAqB,EAAC,MAAM,YAAY,CAAC;AAE3D,MAAM,UAAU,WAAW,CAAC,MAAW;IACrC,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {isBoolean, isBooleanOrBooleanClass} from \"./isBoolean\";\nimport {isNumber, isNumberOrNumberClass} from \"./isNumber\";\nimport {isString, isStringOrStringClass} from \"./isString\";\n\nexport function primitiveOf(target: any): \"string\" | \"number\" | \"boolean\" | \"any\" {\n if (isStringOrStringClass(target)) {\n return \"string\";\n }\n\n if (isNumberOrNumberClass(target)) {\n return \"number\";\n }\n\n if (isBooleanOrBooleanClass(target)) {\n return \"boolean\";\n }\n\n return \"any\";\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { classOf } from "./classOf";
|
|
2
|
+
/**
|
|
3
|
+
* Return the prototype of the given class.
|
|
4
|
+
* @param target
|
|
5
|
+
* @returns {any}
|
|
6
|
+
*/
|
|
7
|
+
export function prototypeOf(target) {
|
|
8
|
+
return classOf(target) === target ? target.prototype : target;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=prototypeOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prototypeOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/prototypeOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAW;IACrC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC","sourcesContent":["import {classOf} from \"./classOf\";\n\n/**\n * Return the prototype of the given class.\n * @param target\n * @returns {any}\n */\nexport function prototypeOf(target: any) {\n return classOf(target) === target ? target.prototype : target;\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isProtectedKey } from "./isProtectedKey";
|
|
2
|
+
export function setValue(scope, expression, value, separator = ".") {
|
|
3
|
+
const keys = expression.split(separator);
|
|
4
|
+
const setValue = (key, add) => {
|
|
5
|
+
if (isProtectedKey(key)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (add) {
|
|
9
|
+
if (typeof scope.set === "function") {
|
|
10
|
+
scope.set(key, value);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
scope[key] = value;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (typeof scope.set === "function") {
|
|
18
|
+
if (!scope.has(key)) {
|
|
19
|
+
scope.set(key, {});
|
|
20
|
+
}
|
|
21
|
+
scope = scope.get(key);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
scope = scope[key] = scope[key] || {};
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
while (setValue(keys.shift(), !keys.length)) { }
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=setValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/setValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,QAAQ,CAAC,KAAU,EAAE,UAAkB,EAAE,KAAU,EAAE,SAAS,GAAG,GAAG;IAClF,MAAM,IAAI,GAAa,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,GAAY,EAAE,EAAE;QAC7C,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,GAAG,EAAE;YACP,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,EAAE;gBACnC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACvB;iBAAM;gBACL,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACpB;YAED,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,EAAE;YACnC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;aACpB;YAED,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACxB;aAAM;YACL,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAE;AAClD,CAAC","sourcesContent":["import {isProtectedKey} from \"./isProtectedKey\";\n\nexport function setValue(scope: any, expression: string, value: any, separator = \".\") {\n const keys: string[] = expression.split(separator);\n\n const setValue = (key: string, add: boolean) => {\n if (isProtectedKey(key)) {\n return false;\n }\n\n if (add) {\n if (typeof scope.set === \"function\") {\n scope.set(key, value);\n } else {\n scope[key] = value;\n }\n\n return false;\n }\n\n if (typeof scope.set === \"function\") {\n if (!scope.has(key)) {\n scope.set(key, {});\n }\n\n scope = scope.get(key);\n } else {\n scope = scope[key] = scope[key] || {};\n }\n\n return true;\n };\n\n while (setValue(keys.shift()!, !keys.length)) {}\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isArray } from "./isArray";
|
|
2
|
+
import { isString } from "./isString";
|
|
3
|
+
function createIdentityFn(keyOrFn) {
|
|
4
|
+
if (!keyOrFn) {
|
|
5
|
+
return (v, k) => String(k);
|
|
6
|
+
}
|
|
7
|
+
if (isString(keyOrFn)) {
|
|
8
|
+
return (item) => {
|
|
9
|
+
return item[keyOrFn];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return keyOrFn;
|
|
13
|
+
}
|
|
14
|
+
export function toMap(input, keyOrFn) {
|
|
15
|
+
if (isArray(input)) {
|
|
16
|
+
const identity = createIdentityFn(keyOrFn || "id");
|
|
17
|
+
return input.reduce((map, value, index) => {
|
|
18
|
+
const ids = [].concat(identity(value, index));
|
|
19
|
+
ids.forEach((id) => map.set(id, value));
|
|
20
|
+
return map;
|
|
21
|
+
}, new Map());
|
|
22
|
+
}
|
|
23
|
+
const identity = createIdentityFn(keyOrFn);
|
|
24
|
+
return Object.entries(input).reduce((map, [key, value]) => {
|
|
25
|
+
return map.set(identity(value, key), value);
|
|
26
|
+
}, new Map());
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=toMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toMap.js","sourceRoot":"","sources":["../../../../src/utils/objects/toMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAKpC,SAAS,gBAAgB,CAAI,OAA0B;IACrD,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC5B;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;QACrB,OAAO,CAAC,IAAS,EAAE,EAAE;YACnB,OAAO,IAAI,CAAC,OAAiB,CAAC,CAAC;QACjC,CAAC,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,KAAK,CAAqC,KAAyB,EAAE,OAA0B;IAC7G,IAAI,OAAO,CAAI,KAAK,CAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,gBAAgB,CAAI,OAAO,IAAI,IAAI,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACxC,MAAM,GAAG,GAAI,EAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YAE5D,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;YAExC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KACf;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAI,OAAO,CAAC,CAAC;IAE9C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACxD,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAU,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAChB,CAAC","sourcesContent":["import {isArray} from \"./isArray\";\nimport {isString} from \"./isString\";\n\nexport type ToMapIdentityCB<V> = (item: V, index: string | number) => string | string[];\nexport type ToMapIdentity<V> = string | ToMapIdentityCB<V>;\n\nfunction createIdentityFn<V>(keyOrFn?: ToMapIdentity<V>): ToMapIdentityCB<V> {\n if (!keyOrFn) {\n return (v, k) => String(k);\n }\n\n if (isString(keyOrFn)) {\n return (item: any) => {\n return item[keyOrFn as string];\n };\n }\n\n return keyOrFn;\n}\n\nexport function toMap<K extends keyof any = any, V = any>(input: Record<K, V> | V[], keyOrFn?: ToMapIdentity<V>): Map<K, V> {\n if (isArray<V>(input)) {\n const identity = createIdentityFn<V>(keyOrFn || \"id\");\n return input.reduce((map, value, index) => {\n const ids = ([] as string[]).concat(identity(value, index));\n\n ids.forEach((id) => map.set(id, value));\n\n return map;\n }, new Map());\n }\n\n const identity = createIdentityFn<V>(keyOrFn);\n\n return Object.entries(input).reduce((map, [key, value]) => {\n return map.set(identity(value as V, key), value);\n }, new Map());\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { constructorOf } from "./constructorOf";
|
|
2
|
+
export function toStringConstructor(target) {
|
|
3
|
+
const ctr = constructorOf(target);
|
|
4
|
+
const strings = ctr.toString().split("\n");
|
|
5
|
+
const ctrString = strings.find((s) => s.indexOf("constructor(") > -1) || "constructor()";
|
|
6
|
+
return `${ctrString.replace("{", "").trim()}`;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=toStringConstructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toStringConstructor.js","sourceRoot":"","sources":["../../../../src/utils/objects/toStringConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,MAAM,UAAU,mBAAmB,CAAC,MAAW;IAC7C,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC;IAEzF,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import {constructorOf} from \"./constructorOf\";\n\nexport function toStringConstructor(target: any): string {\n const ctr = constructorOf(target);\n const strings = ctr.toString().split(\"\\n\");\n const ctrString = strings.find((s) => s.indexOf(\"constructor(\") > -1) || \"constructor()\";\n\n return `${ctrString.replace(\"{\", \"\").trim()}`;\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { uniq } from "./uniq";
|
|
2
|
+
/**
|
|
3
|
+
* Create a complete and iterable trap.
|
|
4
|
+
* @param self
|
|
5
|
+
* @param options
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export function proxyDelegation(self, options = {}) {
|
|
9
|
+
const { handlers = {}, remove, ownKeys } = options;
|
|
10
|
+
const get = options.getter || ((target, propertyKey) => target.get(propertyKey));
|
|
11
|
+
const set = options.setter || ((target, propertyKey, value) => !!target.set(propertyKey, value));
|
|
12
|
+
const itsOwnProp = (target, p) => Reflect.has(target, p) || typeof p === "symbol";
|
|
13
|
+
return new Proxy(self, {
|
|
14
|
+
getOwnPropertyDescriptor(target, p) {
|
|
15
|
+
return Reflect.getOwnPropertyDescriptor(target, p);
|
|
16
|
+
},
|
|
17
|
+
has(target, p) {
|
|
18
|
+
if (itsOwnProp(target, p)) {
|
|
19
|
+
return Reflect.has(target, p);
|
|
20
|
+
}
|
|
21
|
+
return get(target, p) !== undefined;
|
|
22
|
+
},
|
|
23
|
+
get(target, p, receiver) {
|
|
24
|
+
if (itsOwnProp(target, p)) {
|
|
25
|
+
return Reflect.get(target, p, receiver);
|
|
26
|
+
}
|
|
27
|
+
return get(target, p);
|
|
28
|
+
},
|
|
29
|
+
set(target, p, value, receiver) {
|
|
30
|
+
if (itsOwnProp(target, p)) {
|
|
31
|
+
return Reflect.set(target, p, value, receiver);
|
|
32
|
+
}
|
|
33
|
+
return !!set(target, p, value, receiver);
|
|
34
|
+
},
|
|
35
|
+
deleteProperty(target, p) {
|
|
36
|
+
if (itsOwnProp(target, p) || !remove) {
|
|
37
|
+
return Reflect.deleteProperty(target, p);
|
|
38
|
+
}
|
|
39
|
+
return remove(target, p);
|
|
40
|
+
},
|
|
41
|
+
defineProperty(target, p, attributes) {
|
|
42
|
+
return Reflect.defineProperty(target, p, attributes);
|
|
43
|
+
},
|
|
44
|
+
ownKeys(target) {
|
|
45
|
+
return uniq(Reflect.ownKeys(target).concat((ownKeys && ownKeys(target)) || []));
|
|
46
|
+
},
|
|
47
|
+
...handlers
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=proxyDelegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyDelegation.js","sourceRoot":"","sources":["../../../src/utils/proxyDelegation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AA4B5B;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAyB,IAAS,EAAE,UAA8B,EAAE;IACjG,MAAM,EAAC,QAAQ,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;IACjD,MAAM,GAAG,GAA0B,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,MAAW,EAAE,WAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1H,MAAM,GAAG,GACP,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,MAAW,EAAE,WAAwB,EAAE,KAAU,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAE9G,MAAM,UAAU,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;IAEpG,OAAO,IAAI,KAAK,CAAI,IAAI,EAAE;QACxB,wBAAwB,CAAC,MAAW,EAAE,CAAc;YAClD,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACrD,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc;YAC7B,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;aAC/B;YAED,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;QACtC,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,QAAa;YAC5C,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;aACzC;YAED,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACxB,CAAC;QAED,GAAG,CAAC,MAAW,EAAE,CAAc,EAAE,KAAU,EAAE,QAAa;YACxD,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;aAChD;YAED,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;QAED,cAAc,CAAC,MAAW,EAAE,CAAc;YACxC,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;gBACpC,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;aAC1C;YAED,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,cAAc,CAAC,MAAW,EAAE,CAAc,EAAE,UAA8B;YACxE,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,CAAC,MAAW;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;QACD,GAAG,QAAQ;KACZ,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {uniq} from \"./uniq\";\n/**\n * @ignore\n */\nexport type ProxyDelegationGetter<T = any> = (target: T, property: PropertyKey) => any | undefined;\n/**\n * @ignore\n */\nexport type ProxyDelegationRemove<T = any> = (target: T, property: PropertyKey) => any;\n/**\n * @ignore\n */\nexport type ProxyDelegationSetter<T = any> = (target: T, property: PropertyKey, value: any, receiver: any) => any;\n/**\n * @ignore\n */\nexport type ProxyDelegationOwnKeys<T = any> = (target: T) => (string | symbol)[];\n/**\n * @ignore\n */\nexport interface ProxyDelegation<T extends object> {\n handlers?: ProxyHandler<T>;\n getter?: ProxyDelegationGetter<T>;\n setter?: ProxyDelegationSetter<T>;\n remove?: ProxyDelegationRemove<T>;\n ownKeys?: ProxyDelegationOwnKeys<T>;\n}\n\n/**\n * Create a complete and iterable trap.\n * @param self\n * @param options\n * @ignore\n */\nexport function proxyDelegation<T extends object = any>(self: any, options: ProxyDelegation<T> = {}) {\n const {handlers = {}, remove, ownKeys} = options;\n const get: ProxyDelegationGetter = options.getter || ((target: any, propertyKey: PropertyKey) => target.get(propertyKey));\n const set: ProxyDelegationSetter =\n options.setter || ((target: any, propertyKey: PropertyKey, value: any) => !!target.set(propertyKey, value));\n\n const itsOwnProp = (target: any, p: PropertyKey) => Reflect.has(target, p) || typeof p === \"symbol\";\n\n return new Proxy<T>(self, {\n getOwnPropertyDescriptor(target: any, p: PropertyKey): PropertyDescriptor | undefined {\n return Reflect.getOwnPropertyDescriptor(target, p);\n },\n\n has(target: any, p: PropertyKey): boolean {\n if (itsOwnProp(target, p)) {\n return Reflect.has(target, p);\n }\n\n return get(target, p) !== undefined;\n },\n\n get(target: any, p: PropertyKey, receiver: any): any {\n if (itsOwnProp(target, p)) {\n return Reflect.get(target, p, receiver);\n }\n\n return get(target, p);\n },\n\n set(target: any, p: PropertyKey, value: any, receiver: any): boolean {\n if (itsOwnProp(target, p)) {\n return Reflect.set(target, p, value, receiver);\n }\n\n return !!set(target, p as any, value, receiver);\n },\n\n deleteProperty(target: any, p: PropertyKey): boolean {\n if (itsOwnProp(target, p) || !remove) {\n return Reflect.deleteProperty(target, p);\n }\n\n return remove(target, p);\n },\n\n defineProperty(target: any, p: PropertyKey, attributes: PropertyDescriptor): boolean {\n return Reflect.defineProperty(target, p, attributes);\n },\n\n ownKeys(target: any) {\n return uniq(Reflect.ownKeys(target).concat((ownKeys && ownKeys(target)) || []));\n },\n ...handlers\n });\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function uniq(list) {
|
|
2
|
+
return Array.from(new Set(list).values());
|
|
3
|
+
}
|
|
4
|
+
export function uniqBy(list, key = "id") {
|
|
5
|
+
const map = new Map();
|
|
6
|
+
list.forEach((item) => {
|
|
7
|
+
map.set(item[key], item);
|
|
8
|
+
});
|
|
9
|
+
return Array.from(map.values());
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=uniq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniq.js","sourceRoot":"","sources":["../../../src/utils/uniq.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,IAAI,CAAU,IAAS;IACrC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,MAAM,CAAU,IAAS,EAAE,GAAG,GAAG,IAAI;IACnD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IAEtB,IAAI,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;QACzB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAClC,CAAC","sourcesContent":["export function uniq<T = any>(list: T[]): T[] {\n return Array.from(new Set(list).values());\n}\n\nexport function uniqBy<T = any>(list: T[], key = \"id\"): T[] {\n const map = new Map();\n\n list.forEach((item: any) => {\n map.set(item[key], item);\n });\n\n return Array.from(map.values());\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Type } from "./Type";
|
|
1
2
|
/**
|
|
2
3
|
* @ignore
|
|
3
4
|
*/
|
|
@@ -15,7 +16,7 @@ export declare const PROPERTY_STORE = "tsed:property:store";
|
|
|
15
16
|
*/
|
|
16
17
|
export declare const PARAM_STORE = "tsed:param:store";
|
|
17
18
|
export declare class Store {
|
|
18
|
-
|
|
19
|
+
private _entries;
|
|
19
20
|
/**
|
|
20
21
|
* Create or get a Store from args {target + methodName + descriptor}
|
|
21
22
|
* @param args
|
|
@@ -29,6 +30,8 @@ export declare class Store {
|
|
|
29
30
|
* @returns {Store}
|
|
30
31
|
*/
|
|
31
32
|
static fromMethod(target: any, propertyKey: string | symbol): Store;
|
|
33
|
+
static mergeStoreFrom(target: Type<any>, source: Type<any>, ...args: any[]): Store;
|
|
34
|
+
static mergeStoreMethodFrom(target: Type<any>, source: Type<any>, propertyKey: string | symbol): Store;
|
|
32
35
|
/**
|
|
33
36
|
* The get() method returns a specified element from a Map object.
|
|
34
37
|
* @param key Required. The key of the element to return from the Map object.
|
|
@@ -62,4 +65,5 @@ export declare class Store {
|
|
|
62
65
|
* @returns {Store}
|
|
63
66
|
*/
|
|
64
67
|
merge(key: any, value: any, inverse?: boolean): Store;
|
|
68
|
+
toJson(): {};
|
|
65
69
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function importPackage(packageName: string, loaderFn?: Function, optional?: boolean): Promise<any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./catchError";
|
|
2
2
|
export * from "./proxyDelegation";
|
|
3
3
|
export * from "./uniq";
|
|
4
|
+
export * from "./imports/importPackage";
|
|
4
5
|
export * from "./decorators/decorateMethodsOf";
|
|
5
6
|
export * from "./decorators/decoratorArgs";
|
|
6
7
|
export * from "./decorators/decoratorTypeOf";
|
|
@@ -9,3 +10,4 @@ export * from "./decorators/inheritedDescriptorOf";
|
|
|
9
10
|
export * from "./decorators/useDecorators";
|
|
10
11
|
export * from "./decorators/useMethodDecorators";
|
|
11
12
|
export * from "./objects";
|
|
13
|
+
export * from "./http/getHostInfoFromPort";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./ancestorOf";
|
|
2
|
+
export * from "./ancestorsOf";
|
|
2
3
|
export * from "./classOf";
|
|
3
4
|
export * from "./cleanObject";
|
|
4
5
|
export * from "./constructorOf";
|
|
@@ -7,7 +8,7 @@ export * from "./deepMerge";
|
|
|
7
8
|
export * from "./getClassOrSymbol";
|
|
8
9
|
export * from "./getConstructorArgNames";
|
|
9
10
|
export * from "./getEnumerableKeys";
|
|
10
|
-
export * from "./
|
|
11
|
+
export * from "./ancestorOf";
|
|
11
12
|
export * from "./getValue";
|
|
12
13
|
export * from "./isArray";
|
|
13
14
|
export * from "./isArrowFn";
|
|
@@ -30,6 +31,7 @@ export * from "./isProtectedKey";
|
|
|
30
31
|
export * from "./isStream";
|
|
31
32
|
export * from "./isString";
|
|
32
33
|
export * from "./isSymbol";
|
|
34
|
+
export * from "./isSerializable";
|
|
33
35
|
export * from "./methodsOf";
|
|
34
36
|
export * from "./nameOf";
|
|
35
37
|
export * from "./objectKeys";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isArrowFn(target: any): target is Function;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|