@tsed/core 6.87.2 → 6.90.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 -2317
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -2207
- package/lib/index.modern.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.primitiveOf = void 0;
|
|
4
|
+
const isBoolean_1 = require("./isBoolean");
|
|
5
|
+
const isNumber_1 = require("./isNumber");
|
|
6
|
+
const isString_1 = require("./isString");
|
|
7
|
+
function primitiveOf(target) {
|
|
8
|
+
if ((0, isString_1.isStringOrStringClass)(target)) {
|
|
9
|
+
return "string";
|
|
10
|
+
}
|
|
11
|
+
if ((0, isNumber_1.isNumberOrNumberClass)(target)) {
|
|
12
|
+
return "number";
|
|
13
|
+
}
|
|
14
|
+
if ((0, isBoolean_1.isBooleanOrBooleanClass)(target)) {
|
|
15
|
+
return "boolean";
|
|
16
|
+
}
|
|
17
|
+
return "any";
|
|
18
|
+
}
|
|
19
|
+
exports.primitiveOf = primitiveOf;
|
|
20
|
+
//# sourceMappingURL=primitiveOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitiveOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/primitiveOf.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAC/D,yCAA2D;AAC3D,yCAA2D;AAE3D,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,IAAA,gCAAqB,EAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,IAAA,gCAAqB,EAAC,MAAM,CAAC,EAAE;QACjC,OAAO,QAAQ,CAAC;KACjB;IAED,IAAI,IAAA,mCAAuB,EAAC,MAAM,CAAC,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAdD,kCAcC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prototypeOf = void 0;
|
|
4
|
+
const classOf_1 = require("./classOf");
|
|
5
|
+
/**
|
|
6
|
+
* Return the prototype of the given class.
|
|
7
|
+
* @param target
|
|
8
|
+
* @returns {any}
|
|
9
|
+
*/
|
|
10
|
+
function prototypeOf(target) {
|
|
11
|
+
return (0, classOf_1.classOf)(target) === target ? target.prototype : target;
|
|
12
|
+
}
|
|
13
|
+
exports.prototypeOf = prototypeOf;
|
|
14
|
+
//# sourceMappingURL=prototypeOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prototypeOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/prototypeOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAW;IACrC,OAAO,IAAA,iBAAO,EAAC,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC;AAFD,kCAEC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setValue = void 0;
|
|
4
|
+
const isProtectedKey_1 = require("./isProtectedKey");
|
|
5
|
+
function setValue(scope, expression, value, separator = ".") {
|
|
6
|
+
const keys = expression.split(separator);
|
|
7
|
+
const setValue = (key, add) => {
|
|
8
|
+
if ((0, isProtectedKey_1.isProtectedKey)(key)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (add) {
|
|
12
|
+
if (typeof scope.set === "function") {
|
|
13
|
+
scope.set(key, value);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
scope[key] = value;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (typeof scope.set === "function") {
|
|
21
|
+
if (!scope.has(key)) {
|
|
22
|
+
scope.set(key, {});
|
|
23
|
+
}
|
|
24
|
+
scope = scope.get(key);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
scope = scope[key] = scope[key] || {};
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
};
|
|
31
|
+
while (setValue(keys.shift(), !keys.length)) { }
|
|
32
|
+
}
|
|
33
|
+
exports.setValue = setValue;
|
|
34
|
+
//# sourceMappingURL=setValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setValue.js","sourceRoot":"","sources":["../../../../src/utils/objects/setValue.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD,SAAgB,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,IAAA,+BAAc,EAAC,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;AAhCD,4BAgCC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toMap = void 0;
|
|
4
|
+
const isArray_1 = require("./isArray");
|
|
5
|
+
const isString_1 = require("./isString");
|
|
6
|
+
function createIdentityFn(keyOrFn) {
|
|
7
|
+
if (!keyOrFn) {
|
|
8
|
+
return (v, k) => String(k);
|
|
9
|
+
}
|
|
10
|
+
if ((0, isString_1.isString)(keyOrFn)) {
|
|
11
|
+
return (item) => {
|
|
12
|
+
return item[keyOrFn];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return keyOrFn;
|
|
16
|
+
}
|
|
17
|
+
function toMap(input, keyOrFn) {
|
|
18
|
+
if ((0, isArray_1.isArray)(input)) {
|
|
19
|
+
const identity = createIdentityFn(keyOrFn || "id");
|
|
20
|
+
return input.reduce((map, value, index) => {
|
|
21
|
+
const ids = [].concat(identity(value, index));
|
|
22
|
+
ids.forEach((id) => map.set(id, value));
|
|
23
|
+
return map;
|
|
24
|
+
}, new Map());
|
|
25
|
+
}
|
|
26
|
+
const identity = createIdentityFn(keyOrFn);
|
|
27
|
+
return Object.entries(input).reduce((map, [key, value]) => {
|
|
28
|
+
return map.set(identity(value, key), value);
|
|
29
|
+
}, new Map());
|
|
30
|
+
}
|
|
31
|
+
exports.toMap = toMap;
|
|
32
|
+
//# sourceMappingURL=toMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toMap.js","sourceRoot":"","sources":["../../../../src/utils/objects/toMap.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,yCAAoC;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,IAAA,mBAAQ,EAAC,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,SAAgB,KAAK,CAAqC,KAAyB,EAAE,OAA0B;IAC7G,IAAI,IAAA,iBAAO,EAAI,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;AAjBD,sBAiBC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toStringConstructor = void 0;
|
|
4
|
+
const constructorOf_1 = require("./constructorOf");
|
|
5
|
+
function toStringConstructor(target) {
|
|
6
|
+
const ctr = (0, constructorOf_1.constructorOf)(target);
|
|
7
|
+
const strings = ctr.toString().split("\n");
|
|
8
|
+
const ctrString = strings.find((s) => s.indexOf("constructor(") > -1) || "constructor()";
|
|
9
|
+
return `${ctrString.replace("{", "").trim()}`;
|
|
10
|
+
}
|
|
11
|
+
exports.toStringConstructor = toStringConstructor;
|
|
12
|
+
//# sourceMappingURL=toStringConstructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toStringConstructor.js","sourceRoot":"","sources":["../../../../src/utils/objects/toStringConstructor.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,SAAgB,mBAAmB,CAAC,MAAW;IAC7C,MAAM,GAAG,GAAG,IAAA,6BAAa,EAAC,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;AAND,kDAMC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.proxyDelegation = void 0;
|
|
4
|
+
const uniq_1 = require("./uniq");
|
|
5
|
+
/**
|
|
6
|
+
* Create a complete and iterable trap.
|
|
7
|
+
* @param self
|
|
8
|
+
* @param options
|
|
9
|
+
* @ignore
|
|
10
|
+
*/
|
|
11
|
+
function proxyDelegation(self, options = {}) {
|
|
12
|
+
const { handlers = {}, remove, ownKeys } = options;
|
|
13
|
+
const get = options.getter || ((target, propertyKey) => target.get(propertyKey));
|
|
14
|
+
const set = options.setter || ((target, propertyKey, value) => !!target.set(propertyKey, value));
|
|
15
|
+
const itsOwnProp = (target, p) => Reflect.has(target, p) || typeof p === "symbol";
|
|
16
|
+
return new Proxy(self, {
|
|
17
|
+
getOwnPropertyDescriptor(target, p) {
|
|
18
|
+
return Reflect.getOwnPropertyDescriptor(target, p);
|
|
19
|
+
},
|
|
20
|
+
has(target, p) {
|
|
21
|
+
if (itsOwnProp(target, p)) {
|
|
22
|
+
return Reflect.has(target, p);
|
|
23
|
+
}
|
|
24
|
+
return get(target, p) !== undefined;
|
|
25
|
+
},
|
|
26
|
+
get(target, p, receiver) {
|
|
27
|
+
if (itsOwnProp(target, p)) {
|
|
28
|
+
return Reflect.get(target, p, receiver);
|
|
29
|
+
}
|
|
30
|
+
return get(target, p);
|
|
31
|
+
},
|
|
32
|
+
set(target, p, value, receiver) {
|
|
33
|
+
if (itsOwnProp(target, p)) {
|
|
34
|
+
return Reflect.set(target, p, value, receiver);
|
|
35
|
+
}
|
|
36
|
+
return !!set(target, p, value, receiver);
|
|
37
|
+
},
|
|
38
|
+
deleteProperty(target, p) {
|
|
39
|
+
if (itsOwnProp(target, p) || !remove) {
|
|
40
|
+
return Reflect.deleteProperty(target, p);
|
|
41
|
+
}
|
|
42
|
+
return remove(target, p);
|
|
43
|
+
},
|
|
44
|
+
defineProperty(target, p, attributes) {
|
|
45
|
+
return Reflect.defineProperty(target, p, attributes);
|
|
46
|
+
},
|
|
47
|
+
ownKeys(target) {
|
|
48
|
+
return (0, uniq_1.uniq)(Reflect.ownKeys(target).concat((ownKeys && ownKeys(target)) || []));
|
|
49
|
+
},
|
|
50
|
+
...handlers
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.proxyDelegation = proxyDelegation;
|
|
54
|
+
//# sourceMappingURL=proxyDelegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyDelegation.js","sourceRoot":"","sources":["../../../src/utils/proxyDelegation.ts"],"names":[],"mappings":";;;AAAA,iCAA4B;AA4B5B;;;;;GAKG;AACH,SAAgB,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,IAAA,WAAI,EAAC,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;AAtDD,0CAsDC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uniqBy = exports.uniq = void 0;
|
|
4
|
+
function uniq(list) {
|
|
5
|
+
return Array.from(new Set(list).values());
|
|
6
|
+
}
|
|
7
|
+
exports.uniq = uniq;
|
|
8
|
+
function uniqBy(list, key = "id") {
|
|
9
|
+
const map = new Map();
|
|
10
|
+
list.forEach((item) => {
|
|
11
|
+
map.set(item[key], item);
|
|
12
|
+
});
|
|
13
|
+
return Array.from(map.values());
|
|
14
|
+
}
|
|
15
|
+
exports.uniqBy = uniqBy;
|
|
16
|
+
//# sourceMappingURL=uniq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniq.js","sourceRoot":"","sources":["../../../src/utils/uniq.ts"],"names":[],"mappings":";;;AAAA,SAAgB,IAAI,CAAU,IAAS;IACrC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC;AAFD,oBAEC;AAED,SAAgB,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;AARD,wBAQC","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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module common/core
|
|
3
|
+
*/
|
|
4
|
+
import { descriptorOf } from "../utils";
|
|
5
|
+
/** */
|
|
6
|
+
export function Configurable(value = true) {
|
|
7
|
+
return (target, propertyKey) => {
|
|
8
|
+
const descriptor = descriptorOf(target, propertyKey) || { writable: true, enumerable: true };
|
|
9
|
+
descriptor.configurable = value;
|
|
10
|
+
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
11
|
+
return descriptor;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=configurable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,YAAY,CAAC,QAAiB,IAAI;IAChD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC3F,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Configurable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, enumerable: true};\n descriptor.configurable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
3
|
+
*
|
|
4
|
+
* ```typescript
|
|
5
|
+
* provide Foo {
|
|
6
|
+
*
|
|
7
|
+
* @Deprecated("Foo.method: Use Foo.method2 instead")
|
|
8
|
+
* public method() {
|
|
9
|
+
*
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.
|
|
14
|
+
* By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.
|
|
15
|
+
*
|
|
16
|
+
* If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`
|
|
17
|
+
* property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.
|
|
18
|
+
*
|
|
19
|
+
* If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`
|
|
20
|
+
* property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.
|
|
21
|
+
*
|
|
22
|
+
* If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,
|
|
23
|
+
* then an exception will be thrown when the deprecated function is called.
|
|
24
|
+
*
|
|
25
|
+
* The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`
|
|
26
|
+
* and `process.traceDeprecation`.
|
|
27
|
+
*
|
|
28
|
+
* @param message
|
|
29
|
+
* @returns {Function}
|
|
30
|
+
* @decorator
|
|
31
|
+
*/
|
|
32
|
+
export function Deprecated(message) {
|
|
33
|
+
return (target, targetKey, descriptor) => {
|
|
34
|
+
const originalMethod = descriptor.value;
|
|
35
|
+
descriptor.value = require("util").deprecate(originalMethod, message);
|
|
36
|
+
return descriptor;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAwC,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {Type} from \"../domain/Type\";\n\n/**\n * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.\n *\n * ```typescript\n * provide Foo {\n *\n * @Deprecated(\"Foo.method: Use Foo.method2 instead\")\n * public method() {\n *\n * }\n * ```\n *\n * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.\n * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.\n *\n * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`\n * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.\n *\n * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`\n * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.\n *\n * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,\n * then an exception will be thrown when the deprecated function is called.\n *\n * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`\n * and `process.traceDeprecation`.\n *\n * @param message\n * @returns {Function}\n * @decorator\n */\nexport function Deprecated(message: string): Function {\n return (target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<any>) => {\n const originalMethod = descriptor.value;\n\n descriptor.value = require(\"util\").deprecate(originalMethod, message);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module common/core
|
|
3
|
+
*/
|
|
4
|
+
import { descriptorOf } from "../utils";
|
|
5
|
+
/** */
|
|
6
|
+
export function Enumerable(value = true) {
|
|
7
|
+
return (target, propertyKey) => {
|
|
8
|
+
const descriptor = descriptorOf(target, propertyKey) || { writable: true, configurable: true };
|
|
9
|
+
descriptor.enumerable = value;
|
|
10
|
+
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
11
|
+
return descriptor;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=enumerable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,UAAU,CAAC,QAAiB,IAAI;IAC9C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QAC7F,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Enumerable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, configurable: true};\n descriptor.enumerable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module common/core
|
|
3
|
+
*/
|
|
4
|
+
/** */
|
|
5
|
+
export * from "./deprecated";
|
|
6
|
+
export * from "./configurable";
|
|
7
|
+
export * from "./enumerable";
|
|
8
|
+
export * from "./writable";
|
|
9
|
+
export * from "./readOnly";
|
|
10
|
+
export * from "./notConfigurable";
|
|
11
|
+
export * from "./notEnumerable";
|
|
12
|
+
export * from "./storeSet";
|
|
13
|
+
export * from "./storeMerge";
|
|
14
|
+
export * from "./storeFn";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM;AACN,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC","sourcesContent":["/**\n * @module common/core\n */\n/** */\nexport * from \"./deprecated\";\nexport * from \"./configurable\";\nexport * from \"./enumerable\";\nexport * from \"./writable\";\nexport * from \"./readOnly\";\nexport * from \"./notConfigurable\";\nexport * from \"./notEnumerable\";\nexport * from \"./storeSet\";\nexport * from \"./storeMerge\";\nexport * from \"./storeFn\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,MAAM;AACN,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Configurable} from \"./configurable\";\n/** */\nexport function NotConfigurable(): Function {\n return Configurable(false);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,MAAM;AACN,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Enumerable} from \"./enumerable\";\n/** */\nexport function NotEnumerable(): Function {\n return Enumerable(false);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,MAAM;AACN,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {Writable} from \"./writable\";\n/** */\nexport function Readonly(): Function {\n return Writable(false);\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Store } from "../domain/Store";
|
|
2
|
+
/**
|
|
3
|
+
* Create a store correctly configured from the parameters given by the decorator.
|
|
4
|
+
* The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).
|
|
5
|
+
* @param {(store: Store, parameters: DecoratorParameters) => void} fn
|
|
6
|
+
* @returns {Function}
|
|
7
|
+
*/
|
|
8
|
+
export function StoreFn(fn) {
|
|
9
|
+
return (...parameters) => {
|
|
10
|
+
const store = Store.from(...parameters);
|
|
11
|
+
const result = fn(store, parameters);
|
|
12
|
+
if (typeof result === "function") {
|
|
13
|
+
result(...parameters);
|
|
14
|
+
}
|
|
15
|
+
return parameters[2];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=storeFn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeFn.js","sourceRoot":"","sources":["../../../src/decorators/storeFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,EAA2D;IACjF,OAAO,CAAC,GAAG,UAAiB,EAAO,EAAE;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QACxC,MAAM,MAAM,GAAQ,EAAE,CAAC,KAAK,EAAE,UAAiC,CAAC,CAAC;QACjE,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;QAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {DecoratorParameters} from \"../interfaces/DecoratorParameters\";\n\n/**\n * Create a store correctly configured from the parameters given by the decorator.\n * The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).\n * @param {(store: Store, parameters: DecoratorParameters) => void} fn\n * @returns {Function}\n */\nexport function StoreFn(fn: (store: Store, parameters: DecoratorParameters) => void): Function {\n return (...parameters: any[]): any => {\n const store = Store.from(...parameters);\n const result: any = fn(store, parameters as DecoratorParameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n\n return parameters[2];\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeMerge.js","sourceRoot":"","sources":["../../../src/decorators/storeMerge.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,UAAU,CAAC,GAAQ,EAAE,KAAU;IAC7C,OAAO,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreMerge(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.merge(key, value);\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeSet.js","sourceRoot":"","sources":["../../../src/decorators/storeSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,QAAQ,CAAC,GAAQ,EAAE,KAAU;IAC3C,OAAO,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreSet(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.set(key, value);\n });\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module common/core
|
|
3
|
+
*/
|
|
4
|
+
import { descriptorOf } from "../utils";
|
|
5
|
+
/** */
|
|
6
|
+
export function Writable(value = true) {
|
|
7
|
+
return (target, propertyKey) => {
|
|
8
|
+
const descriptor = descriptorOf(target, propertyKey) || { configurable: true, enumerable: true };
|
|
9
|
+
descriptor.writable = value;
|
|
10
|
+
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
11
|
+
return descriptor;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=writable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM;AAEN,MAAM,UAAU,QAAQ,CAAC,QAAiB,IAAI;IAC5C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC/F,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Writable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {configurable: true, enumerable: true};\n descriptor.writable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
var _AnyToPromise_resolves, _AnyToPromise_rejects, _AnyToPromise_hasNextFunction, _AnyToPromise_promise;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
+
import { isObservable } from "../utils/objects/isObservable";
|
|
4
|
+
import { isPromise } from "../utils/objects/isPromise";
|
|
5
|
+
import { isStream } from "../utils/objects/isStream";
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
function isResponse(obj) {
|
|
10
|
+
return obj.data && obj.headers && obj.status && obj.statusText;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
export var AnyToPromiseStatus;
|
|
16
|
+
(function (AnyToPromiseStatus) {
|
|
17
|
+
AnyToPromiseStatus["PENDING"] = "PENDING";
|
|
18
|
+
AnyToPromiseStatus["CANCELED"] = "CANCELED";
|
|
19
|
+
AnyToPromiseStatus["RESOLVED"] = "RESOLVED";
|
|
20
|
+
AnyToPromiseStatus["REJECTED"] = "REJECTED";
|
|
21
|
+
})(AnyToPromiseStatus || (AnyToPromiseStatus = {}));
|
|
22
|
+
export var AnyToPromiseResponseTypes;
|
|
23
|
+
(function (AnyToPromiseResponseTypes) {
|
|
24
|
+
AnyToPromiseResponseTypes["STREAM"] = "STREAM";
|
|
25
|
+
AnyToPromiseResponseTypes["BUFFER"] = "BUFFER";
|
|
26
|
+
AnyToPromiseResponseTypes["DATA"] = "DATA";
|
|
27
|
+
})(AnyToPromiseResponseTypes || (AnyToPromiseResponseTypes = {}));
|
|
28
|
+
export class AnyToPromise {
|
|
29
|
+
constructor({ hasNextFunction = false } = {}) {
|
|
30
|
+
this.status = AnyToPromiseStatus.PENDING;
|
|
31
|
+
_AnyToPromise_resolves.set(this, void 0);
|
|
32
|
+
_AnyToPromise_rejects.set(this, void 0);
|
|
33
|
+
_AnyToPromise_hasNextFunction.set(this, false);
|
|
34
|
+
_AnyToPromise_promise.set(this, void 0);
|
|
35
|
+
__classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, hasNextFunction, "f");
|
|
36
|
+
__classPrivateFieldSet(this, _AnyToPromise_promise, new Promise((resolve, reject) => {
|
|
37
|
+
__classPrivateFieldSet(this, _AnyToPromise_resolves, resolve, "f");
|
|
38
|
+
__classPrivateFieldSet(this, _AnyToPromise_rejects, reject, "f");
|
|
39
|
+
}), "f");
|
|
40
|
+
}
|
|
41
|
+
isDone() {
|
|
42
|
+
return this.status !== AnyToPromiseStatus.PENDING;
|
|
43
|
+
}
|
|
44
|
+
get next() {
|
|
45
|
+
__classPrivateFieldSet(this, _AnyToPromise_hasNextFunction, true, "f");
|
|
46
|
+
return (error) => {
|
|
47
|
+
if (this.isDone()) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return error ? this.reject(error) : this.resolve({ type: AnyToPromiseResponseTypes.DATA });
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
async call(cb) {
|
|
57
|
+
if (this.isDone()) {
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
this.handle(cb());
|
|
62
|
+
}
|
|
63
|
+
catch (er) {
|
|
64
|
+
this.reject(er);
|
|
65
|
+
}
|
|
66
|
+
return __classPrivateFieldGet(this, _AnyToPromise_promise, "f");
|
|
67
|
+
}
|
|
68
|
+
reject(er) {
|
|
69
|
+
if (this.isDone()) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.done(AnyToPromiseStatus.REJECTED);
|
|
73
|
+
__classPrivateFieldGet(this, _AnyToPromise_rejects, "f").call(this, er);
|
|
74
|
+
}
|
|
75
|
+
resolve(response = {}) {
|
|
76
|
+
if (this.isDone()) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.done(AnyToPromiseStatus.RESOLVED);
|
|
80
|
+
__classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { ...response, state: AnyToPromiseStatus.RESOLVED });
|
|
81
|
+
}
|
|
82
|
+
destroy() { }
|
|
83
|
+
cancel() {
|
|
84
|
+
if (this.isDone()) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.done(AnyToPromiseStatus.CANCELED);
|
|
88
|
+
return __classPrivateFieldGet(this, _AnyToPromise_resolves, "f").call(this, { state: AnyToPromiseStatus.CANCELED });
|
|
89
|
+
}
|
|
90
|
+
done(status) {
|
|
91
|
+
this.destroy();
|
|
92
|
+
this.status = status;
|
|
93
|
+
}
|
|
94
|
+
handle(process, additionalProps = {}) {
|
|
95
|
+
if (this.isDone()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (process) {
|
|
99
|
+
if (this.isCanceledResponse(process)) {
|
|
100
|
+
// ABANDON
|
|
101
|
+
return this.cancel();
|
|
102
|
+
}
|
|
103
|
+
if (isObservable(process)) {
|
|
104
|
+
process = process.toPromise();
|
|
105
|
+
}
|
|
106
|
+
if (isResponse(process)) {
|
|
107
|
+
return this.handle(process.data, {
|
|
108
|
+
...additionalProps,
|
|
109
|
+
status: process.status,
|
|
110
|
+
headers: process.headers
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (isStream(process)) {
|
|
114
|
+
return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process });
|
|
115
|
+
}
|
|
116
|
+
if (isStream(process) || Buffer.isBuffer(process)) {
|
|
117
|
+
return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process });
|
|
118
|
+
}
|
|
119
|
+
if (isPromise(process)) {
|
|
120
|
+
return process
|
|
121
|
+
.then((result) => this.handle(result, additionalProps))
|
|
122
|
+
.catch((error) => {
|
|
123
|
+
if (error.response && isResponse(error.response)) {
|
|
124
|
+
return this.handle(error.response);
|
|
125
|
+
}
|
|
126
|
+
return this.reject(error);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!__classPrivateFieldGet(this, _AnyToPromise_hasNextFunction, "f")) {
|
|
131
|
+
// no next function and empty response
|
|
132
|
+
return this.resolve({
|
|
133
|
+
...additionalProps,
|
|
134
|
+
data: process,
|
|
135
|
+
type: AnyToPromiseResponseTypes.DATA
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
isCanceledResponse(process) {
|
|
140
|
+
return process === AnyToPromiseStatus.CANCELED;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
_AnyToPromise_resolves = new WeakMap(), _AnyToPromise_rejects = new WeakMap(), _AnyToPromise_hasNextFunction = new WeakMap(), _AnyToPromise_promise = new WeakMap();
|
|
144
|
+
//# sourceMappingURL=AnyToPromise.js.map
|