@tsed/core 7.0.0-alpha.2 → 7.0.0-beta.1
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 +0 -0
- 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 → types/utils}/objects/ancestorOf.d.ts +0 -0
- package/lib/{utils → 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 +0 -0
- 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/{utils → types/utils}/objects/isSerializable.d.ts +0 -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 -10
- package/tsconfig.compile.esm.json +23 -0
- package/lib/domain/Entity.d.ts +0 -97
- package/lib/index.js +0 -2298
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -2210
- 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,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Store = exports.PARAM_STORE = exports.PROPERTY_STORE = exports.METHOD_STORE = exports.CLASS_STORE = void 0;
|
|
4
|
+
const DecoratorTypes_1 = require("../domain/DecoratorTypes");
|
|
5
|
+
const decoratorTypeOf_1 = require("../utils/decorators/decoratorTypeOf");
|
|
6
|
+
const deepClone_1 = require("../utils/objects/deepClone");
|
|
7
|
+
const deepMerge_1 = require("../utils/objects/deepMerge");
|
|
8
|
+
const descriptorOf_1 = require("../utils/objects/descriptorOf");
|
|
9
|
+
const isSymbol_1 = require("../utils/objects/isSymbol");
|
|
10
|
+
const nameOf_1 = require("../utils/objects/nameOf");
|
|
11
|
+
const Metadata_1 = require("./Metadata");
|
|
12
|
+
/**
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
exports.CLASS_STORE = "tsed:class:store";
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
exports.METHOD_STORE = "tsed:method:store";
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
exports.PROPERTY_STORE = "tsed:property:store";
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
exports.PARAM_STORE = "tsed:param:store";
|
|
28
|
+
const stores = new Map();
|
|
29
|
+
function storeGet(key, ...args) {
|
|
30
|
+
if ((0, isSymbol_1.isSymbol)(args[0])) {
|
|
31
|
+
if (!stores.has(args[0])) {
|
|
32
|
+
stores.set(args[0], new Store());
|
|
33
|
+
}
|
|
34
|
+
return stores.get(args[0]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const registry = Metadata_1.Metadata;
|
|
38
|
+
if (!registry.hasOwn(key, ...args)) {
|
|
39
|
+
registry.set(key, new Store(), ...args);
|
|
40
|
+
}
|
|
41
|
+
return registry.getOwn(key, ...args);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function defineStore(args) {
|
|
45
|
+
const [target, propertyKey, descriptor] = args;
|
|
46
|
+
switch ((0, decoratorTypeOf_1.decoratorTypeOf)(args)) {
|
|
47
|
+
case DecoratorTypes_1.DecoratorTypes.PARAM_CTOR:
|
|
48
|
+
case DecoratorTypes_1.DecoratorTypes.PARAM_STC:
|
|
49
|
+
case DecoratorTypes_1.DecoratorTypes.PARAM:
|
|
50
|
+
const store = storeGet(exports.PARAM_STORE, target, propertyKey);
|
|
51
|
+
if (!store.has("" + descriptor)) {
|
|
52
|
+
store.set("" + descriptor, new Store());
|
|
53
|
+
}
|
|
54
|
+
return store.get("" + descriptor);
|
|
55
|
+
case DecoratorTypes_1.DecoratorTypes.PROP:
|
|
56
|
+
case DecoratorTypes_1.DecoratorTypes.PROP_STC:
|
|
57
|
+
return storeGet(exports.PROPERTY_STORE, target, propertyKey);
|
|
58
|
+
case DecoratorTypes_1.DecoratorTypes.METHOD:
|
|
59
|
+
case DecoratorTypes_1.DecoratorTypes.METHOD_STC:
|
|
60
|
+
return storeGet(exports.METHOD_STORE, target, propertyKey);
|
|
61
|
+
case DecoratorTypes_1.DecoratorTypes.CLASS:
|
|
62
|
+
return storeGet(exports.CLASS_STORE, target);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
class Store {
|
|
66
|
+
constructor() {
|
|
67
|
+
this._entries = new Map();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Create or get a Store from args {target + methodName + descriptor}
|
|
71
|
+
* @param args
|
|
72
|
+
* @returns {Store}
|
|
73
|
+
*/
|
|
74
|
+
static from(...args) {
|
|
75
|
+
return defineStore(args);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create store on the method.
|
|
79
|
+
* @param target
|
|
80
|
+
* @param {string} propertyKey
|
|
81
|
+
* @returns {Store}
|
|
82
|
+
*/
|
|
83
|
+
static fromMethod(target, propertyKey) {
|
|
84
|
+
return Store.from(target, propertyKey, (0, descriptorOf_1.descriptorOf)(target, propertyKey));
|
|
85
|
+
}
|
|
86
|
+
static mergeStoreFrom(target, source, ...args) {
|
|
87
|
+
const store = Store.from(target, ...args);
|
|
88
|
+
Store.from(source, ...args)._entries.forEach((value, key) => {
|
|
89
|
+
store.merge(key, value);
|
|
90
|
+
});
|
|
91
|
+
return store;
|
|
92
|
+
}
|
|
93
|
+
static mergeStoreMethodFrom(target, source, propertyKey) {
|
|
94
|
+
return this.mergeStoreFrom(target, source, propertyKey, (0, descriptorOf_1.descriptorOf)(target, propertyKey));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The get() method returns a specified element from a Map object.
|
|
98
|
+
* @param key Required. The key of the element to return from the Map object.
|
|
99
|
+
* @param defaultValue
|
|
100
|
+
* @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
|
|
101
|
+
*/
|
|
102
|
+
get(key, defaultValue) {
|
|
103
|
+
return this._entries.get((0, nameOf_1.nameOf)(key)) || defaultValue;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The has() method returns a boolean indicating whether an element with the specified key exists or not.
|
|
107
|
+
* @param key
|
|
108
|
+
* @returns {boolean}
|
|
109
|
+
*/
|
|
110
|
+
has(key) {
|
|
111
|
+
return this._entries.has((0, nameOf_1.nameOf)(key));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The set() method adds or updates an element with a specified key and value to a Map object.
|
|
115
|
+
* @param key Required. The key of the element to add to the Map object.
|
|
116
|
+
* @param metadata Required. The value of the element to add to the Map object.
|
|
117
|
+
*/
|
|
118
|
+
set(key, metadata) {
|
|
119
|
+
this._entries.set((0, nameOf_1.nameOf)(key), metadata);
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The delete() method removes the specified element from a Map object.
|
|
124
|
+
* @param key Required. The key of the element to remove from the Map object.
|
|
125
|
+
* @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
|
|
126
|
+
*/
|
|
127
|
+
delete(key) {
|
|
128
|
+
return this._entries.delete((0, nameOf_1.nameOf)(key));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Merge given value with existing value.
|
|
132
|
+
* @param key
|
|
133
|
+
* @param value
|
|
134
|
+
* @param inverse Change the merge order. Get the existing value and apply over given value
|
|
135
|
+
* @returns {Store}
|
|
136
|
+
*/
|
|
137
|
+
merge(key, value, inverse = false) {
|
|
138
|
+
let _value_ = this.get(key);
|
|
139
|
+
if (_value_) {
|
|
140
|
+
value = (0, deepClone_1.deepClone)(value);
|
|
141
|
+
_value_ = (0, deepClone_1.deepClone)(_value_);
|
|
142
|
+
value = inverse ? (0, deepMerge_1.deepMerge)(value, _value_) : (0, deepMerge_1.deepMerge)(_value_, value);
|
|
143
|
+
}
|
|
144
|
+
this.set(key, value);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
toJson() {
|
|
148
|
+
return [...this._entries.entries()].reduce((obj, [key, value]) => {
|
|
149
|
+
return {
|
|
150
|
+
...obj,
|
|
151
|
+
[key]: value
|
|
152
|
+
};
|
|
153
|
+
}, {});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.Store = Store;
|
|
157
|
+
//# sourceMappingURL=Store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/domain/Store.ts"],"names":[],"mappings":"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","sourcesContent":["import {DecoratorTypes} from \"../domain/DecoratorTypes\";\nimport {decoratorTypeOf} from \"../utils/decorators/decoratorTypeOf\";\nimport {deepClone} from \"../utils/objects/deepClone\";\nimport {deepMerge} from \"../utils/objects/deepMerge\";\nimport {descriptorOf} from \"../utils/objects/descriptorOf\";\nimport {isSymbol} from \"../utils/objects/isSymbol\";\nimport {nameOf} from \"../utils/objects/nameOf\";\nimport {Metadata} from \"./Metadata\";\nimport type {Type} from \"./Type\";\n\n/**\n * @ignore\n */\nexport const CLASS_STORE = \"tsed:class:store\";\n/**\n * @ignore\n */\nexport const METHOD_STORE = \"tsed:method:store\";\n/**\n * @ignore\n */\nexport const PROPERTY_STORE = \"tsed:property:store\";\n/**\n * @ignore\n */\nexport const PARAM_STORE = \"tsed:param:store\";\n\nconst stores = new Map<symbol, Store>();\n\nfunction storeGet(key: string, ...args: any[]): Store {\n if (isSymbol(args[0])) {\n if (!stores.has(args[0])) {\n stores.set(args[0], new Store());\n }\n\n return stores.get(args[0])!;\n } else {\n const registry = Metadata as any;\n\n if (!registry.hasOwn(key, ...args)) {\n registry.set(key, new Store(), ...args);\n }\n\n return registry.getOwn(key, ...args);\n }\n}\n\nfunction defineStore(args: any[]): Store {\n const [target, propertyKey, descriptor] = args;\n\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PARAM_CTOR:\n case DecoratorTypes.PARAM_STC:\n case DecoratorTypes.PARAM:\n const store = storeGet(PARAM_STORE, target, propertyKey);\n if (!store.has(\"\" + descriptor)) {\n store.set(\"\" + descriptor, new Store());\n }\n\n return store.get(\"\" + descriptor);\n case DecoratorTypes.PROP:\n case DecoratorTypes.PROP_STC:\n return storeGet(PROPERTY_STORE, target, propertyKey);\n case DecoratorTypes.METHOD:\n case DecoratorTypes.METHOD_STC:\n return storeGet(METHOD_STORE, target, propertyKey);\n case DecoratorTypes.CLASS:\n return storeGet(CLASS_STORE, target);\n }\n}\n\nexport class Store {\n private _entries = new Map<string, any>();\n /**\n * Create or get a Store from args {target + methodName + descriptor}\n * @param args\n * @returns {Store}\n */\n static from(...args: any[]): Store {\n return defineStore(args);\n }\n\n /**\n * Create store on the method.\n * @param target\n * @param {string} propertyKey\n * @returns {Store}\n */\n static fromMethod(target: any, propertyKey: string | symbol): Store {\n return Store.from(target, propertyKey, descriptorOf(target, propertyKey));\n }\n\n static mergeStoreFrom(target: Type<any>, source: Type<any>, ...args: any[]) {\n const store = Store.from(target, ...args);\n\n Store.from(source, ...args)._entries.forEach((value, key) => {\n store.merge(key, value);\n });\n\n return store;\n }\n\n static mergeStoreMethodFrom(target: Type<any>, source: Type<any>, propertyKey: string | symbol) {\n return this.mergeStoreFrom(target, source, propertyKey, descriptorOf(target, propertyKey));\n }\n\n /**\n * The get() method returns a specified element from a Map object.\n * @param key Required. The key of the element to return from the Map object.\n * @param defaultValue\n * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.\n */\n get<T = any>(key: any, defaultValue?: any): T {\n return this._entries.get(nameOf(key)) || defaultValue;\n }\n\n /**\n * The has() method returns a boolean indicating whether an element with the specified key exists or not.\n * @param key\n * @returns {boolean}\n */\n has(key: any): boolean {\n return this._entries.has(nameOf(key));\n }\n\n /**\n * The set() method adds or updates an element with a specified key and value to a Map object.\n * @param key Required. The key of the element to add to the Map object.\n * @param metadata Required. The value of the element to add to the Map object.\n */\n set(key: any, metadata: any): Store {\n this._entries.set(nameOf(key), metadata);\n\n return this;\n }\n\n /**\n * The delete() method removes the specified element from a Map object.\n * @param key Required. The key of the element to remove from the Map object.\n * @returns {boolean} Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.\n */\n delete(key: string): boolean {\n return this._entries.delete(nameOf(key));\n }\n\n /**\n * Merge given value with existing value.\n * @param key\n * @param value\n * @param inverse Change the merge order. Get the existing value and apply over given value\n * @returns {Store}\n */\n merge(key: any, value: any, inverse: boolean = false): Store {\n let _value_ = this.get(key);\n\n if (_value_) {\n value = deepClone(value);\n _value_ = deepClone(_value_);\n value = inverse ? deepMerge(value, _value_) : deepMerge(_value_, value);\n }\n\n this.set(key, value);\n\n return this;\n }\n\n toJson() {\n return [...this._entries.entries()].reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: value\n };\n }, {});\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Type.js","sourceRoot":"","sources":["../../../src/domain/Type.ts"],"names":[],"mappings":";;;AAYa,QAAA,IAAI,GAAG,QAAQ,CAAC;AAE7B,aAAa;AACb,MAAM,CAAC,IAAI,GAAG,YAAI,CAAC","sourcesContent":["/**\n * An example of a `Type` is `MyCustomComponent` filters, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n */\n// tslint:disable-next-line: variable-name\n/**\n *\n */\nexport interface Type<T = any> extends Function {\n new (...args: any[]): T;\n}\n\nexport const Type = Function;\n\n// @ts-ignore\nglobal.Type = Type;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./DecoratorTypes"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./Env"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./Hooks"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./Metadata"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./Store"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./Type"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./AnyToPromise"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,qDAAsB;AACtB,uDAAwB;AACxB,0DAA2B;AAC3B,uDAAwB;AACxB,sDAAuB;AACvB,8DAA+B","sourcesContent":["export * from \"./DecoratorTypes\";\nexport * from \"./Env\";\nexport * from \"./Hooks\";\nexport * from \"./Metadata\";\nexport * from \"./Store\";\nexport * from \"./Type\";\nexport * from \"./AnyToPromise\";\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnsupportedDecoratorType = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
class UnsupportedDecoratorType extends Error {
|
|
6
|
+
constructor(decorator, args) {
|
|
7
|
+
super(UnsupportedDecoratorType.buildMessage(decorator, args));
|
|
8
|
+
}
|
|
9
|
+
static buildMessage(decorator, args) {
|
|
10
|
+
const [target, propertyKey, index] = args;
|
|
11
|
+
const bindingType = (0, utils_1.decoratorTypeOf)(args);
|
|
12
|
+
const shortBinding = bindingType.split("/")[0];
|
|
13
|
+
const param = shortBinding === "parameter" ? ".[" + index + "]" : "";
|
|
14
|
+
const cstr = shortBinding === "parameter" ? ".constructor" : "";
|
|
15
|
+
const method = propertyKey ? "." + propertyKey : cstr;
|
|
16
|
+
const path = (0, utils_1.nameOf)((0, utils_1.classOf)(target)) + method + param;
|
|
17
|
+
return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.UnsupportedDecoratorType = UnsupportedDecoratorType;
|
|
21
|
+
//# sourceMappingURL=UnsupportedDecoratorType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":";;;AAAA,oCAA0D;AAE1D,MAAa,wBAAyB,SAAQ,KAAK;IAGjD,YAAY,SAAc,EAAE,IAAW;QACrC,KAAK,CAAC,wBAAwB,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,SAAc,EAAE,IAAW;QACrD,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAE1C,MAAM,WAAW,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,MAAM,IAAI,GAAG,IAAA,cAAM,EAAC,IAAA,eAAO,EAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;QAEtD,OAAO,GAAG,SAAS,CAAC,IAAI,sBAAsB,WAAW,iBAAiB,IAAI,EAAE,CAAC;IACnF,CAAC;CACF;AApBD,4DAoBC","sourcesContent":["import {classOf, decoratorTypeOf, nameOf} from \"../utils\";\n\nexport class UnsupportedDecoratorType extends Error {\n name: \"UNSUPPORTED_DECORATOR_TYPE\";\n\n constructor(decorator: any, args: any[]) {\n super(UnsupportedDecoratorType.buildMessage(decorator, args));\n }\n\n private static buildMessage(decorator: any, args: any[]): string {\n const [target, propertyKey, index] = args;\n\n const bindingType = decoratorTypeOf(args);\n const shortBinding = bindingType.split(\"/\")[0];\n const param = shortBinding === \"parameter\" ? \".[\" + index + \"]\" : \"\";\n const cstr = shortBinding === \"parameter\" ? \".constructor\" : \"\";\n const method = propertyKey ? \".\" + propertyKey : cstr;\n\n const path = nameOf(classOf(target)) + method + param;\n\n return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;\n }\n}\n"]}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./utils"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./domain"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./errors/UnsupportedDecoratorType"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./decorators"), exports);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAG1B,uDAAwB;AACxB,wDAAyB;AACzB,iFAAkD;AAClD,4DAA6B","sourcesContent":["import \"reflect-metadata\";\n\nexport type {DecoratorParameters, DecoratorMethodParameters, StaticMethodDecorator, MetadataTypes, ValueOf, HashOf} from \"./interfaces\";\nexport * from \"./utils\";\nexport * from \"./domain\";\nexport * from \"./errors/UnsupportedDecoratorType\";\nexport * from \"./decorators\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnyDecorator.js","sourceRoot":"","sources":["../../../src/interfaces/AnyDecorator.ts"],"names":[],"mappings":"","sourcesContent":["export type AnyDecorator = any | ClassDecorator | MethodDecorator | PropertyDescriptor | ParameterDecorator;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecoratorParameters.js","sourceRoot":"","sources":["../../../src/interfaces/DecoratorParameters.ts"],"names":[],"mappings":"","sourcesContent":["export type DecoratorParameters = [any, string | symbol, number | PropertyDescriptor];\nexport type DecoratorMethodParameters = [any, string | symbol, PropertyDescriptor];\n\nexport type StaticMethodDecorator = <TFunction extends Function, T>(\n target: TFunction,\n propertyKey: string | symbol,\n descriptor: TypedPropertyDescriptor<T>\n) => TypedPropertyDescriptor<T> | void;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashOf.js","sourceRoot":"","sources":["../../../src/interfaces/HashOf.ts"],"names":[],"mappings":"","sourcesContent":["export type HashOf<T> = Record<string, T>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetadataTypes.js","sourceRoot":"","sources":["../../../src/interfaces/MetadataTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type {Type} from \"../domain/Type\";\n\nexport interface MetadataTypes<T = any, C = any> {\n type?: Type<T> | T;\n collectionType?: Type<C> | C;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueOf.js","sourceRoot":"","sources":["../../../src/interfaces/ValueOf.ts"],"names":[],"mappings":"","sourcesContent":["export type ValueOf<T> = T[keyof T];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"","sourcesContent":["export type {DecoratorParameters, DecoratorMethodParameters, StaticMethodDecorator} from \"./DecoratorParameters\";\nexport type {MetadataTypes} from \"./MetadataTypes\";\nexport type {ValueOf} from \"./ValueOf\";\nexport type {HashOf} from \"./HashOf\";\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.catchAsyncError = exports.catchError = void 0;
|
|
4
|
+
function catchError(cb) {
|
|
5
|
+
try {
|
|
6
|
+
cb();
|
|
7
|
+
}
|
|
8
|
+
catch (er) {
|
|
9
|
+
return er;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.catchError = catchError;
|
|
13
|
+
async function catchAsyncError(cb) {
|
|
14
|
+
try {
|
|
15
|
+
await cb();
|
|
16
|
+
}
|
|
17
|
+
catch (er) {
|
|
18
|
+
return er;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.catchAsyncError = catchAsyncError;
|
|
22
|
+
//# sourceMappingURL=catchError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catchError.js","sourceRoot":"","sources":["../../../src/utils/catchError.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAkB,EAAY;IACtD,IAAI;QACF,EAAE,EAAE,CAAC;KACN;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAND,gCAMC;AAEM,KAAK,UAAU,eAAe,CAAkB,EAAY;IACjE,IAAI;QACF,MAAM,EAAE,EAAE,CAAC;KACZ;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAND,0CAMC","sourcesContent":["export function catchError<T extends Error>(cb: Function): T | undefined {\n try {\n cb();\n } catch (er) {\n return er;\n }\n}\n\nexport async function catchAsyncError<T extends Error>(cb: Function): Promise<T | undefined> {\n try {\n await cb();\n } catch (er) {\n return er;\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decorateMethodsOf = void 0;
|
|
4
|
+
const classOf_1 = require("../objects/classOf");
|
|
5
|
+
const methodsOf_1 = require("../objects/methodsOf");
|
|
6
|
+
const prototypeOf_1 = require("../objects/prototypeOf");
|
|
7
|
+
const descriptorOf_1 = require("../objects/descriptorOf");
|
|
8
|
+
const Store_1 = require("../../domain/Store");
|
|
9
|
+
function decorateMethodsOf(klass, decorator) {
|
|
10
|
+
(0, methodsOf_1.methodsOf)(klass).forEach(({ target, propertyKey }) => {
|
|
11
|
+
if (target !== (0, classOf_1.classOf)(klass)) {
|
|
12
|
+
Object.defineProperty((0, prototypeOf_1.prototypeOf)(klass), propertyKey, {
|
|
13
|
+
value(...args) {
|
|
14
|
+
return (0, prototypeOf_1.prototypeOf)(target)[propertyKey].apply(this, args);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Store_1.Store.mergeStoreMethodFrom(klass, target, propertyKey);
|
|
18
|
+
}
|
|
19
|
+
decorator((0, prototypeOf_1.prototypeOf)(klass), propertyKey, (0, descriptorOf_1.descriptorOf)(klass, propertyKey));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.decorateMethodsOf = decorateMethodsOf;
|
|
23
|
+
//# sourceMappingURL=decorateMethodsOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":";;;AAAA,gDAA2C;AAC3C,oDAA+C;AAC/C,wDAAmD;AACnD,0DAAqD;AACrD,8CAAyC;AAEzC,SAAgB,iBAAiB,CAAC,KAAU,EAAE,SAAc;IAC1D,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE;QACjD,IAAI,MAAM,KAAK,IAAA,iBAAO,EAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,CAAC,IAAA,yBAAW,EAAC,KAAK,CAAC,EAAE,WAAW,EAAE;gBACrD,KAAK,CAAC,GAAG,IAAW;oBAClB,OAAO,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5D,CAAC;aACF,CAAC,CAAC;YAEH,aAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SACxD;QAED,SAAS,CAAC,IAAA,yBAAW,EAAC,KAAK,CAAC,EAAE,WAAW,EAAE,IAAA,2BAAY,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,8CAcC","sourcesContent":["import {classOf} from \"../objects/classOf\";\nimport {methodsOf} from \"../objects/methodsOf\";\nimport {prototypeOf} from \"../objects/prototypeOf\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\nimport {Store} from \"../../domain/Store\";\n\nexport function decorateMethodsOf(klass: any, decorator: any) {\n methodsOf(klass).forEach(({target, propertyKey}) => {\n if (target !== classOf(klass)) {\n Object.defineProperty(prototypeOf(klass), propertyKey, {\n value(...args: any[]) {\n return prototypeOf(target)[propertyKey].apply(this, args);\n }\n });\n\n Store.mergeStoreMethodFrom(klass, target, propertyKey);\n }\n\n decorator(prototypeOf(klass), propertyKey, descriptorOf(klass, propertyKey));\n });\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decoratorArgs = void 0;
|
|
4
|
+
const descriptorOf_1 = require("../objects/descriptorOf");
|
|
5
|
+
function decoratorArgs(target, propertyKey) {
|
|
6
|
+
return [target, propertyKey, (0, descriptorOf_1.descriptorOf)(target, propertyKey)];
|
|
7
|
+
}
|
|
8
|
+
exports.decoratorArgs = decoratorArgs;
|
|
9
|
+
//# sourceMappingURL=decoratorArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoratorArgs.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decoratorArgs.ts"],"names":[],"mappings":";;;AACA,0DAAqD;AAErD,SAAgB,aAAa,CAAC,MAAW,EAAE,WAAmB;IAC5D,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAE,CAAC,CAAC;AACnE,CAAC;AAFD,sCAEC","sourcesContent":["import {DecoratorParameters} from \"../../interfaces/DecoratorParameters\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\n\nexport function decoratorArgs(target: any, propertyKey: string): DecoratorParameters {\n return [target, propertyKey, descriptorOf(target, propertyKey)!];\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decoratorTypeOf = void 0;
|
|
4
|
+
const DecoratorTypes_1 = require("../../domain/DecoratorTypes");
|
|
5
|
+
const classOf_1 = require("../objects/classOf");
|
|
6
|
+
function decoratorTypeOf(args) {
|
|
7
|
+
const [target, propertyKey, descriptor] = args;
|
|
8
|
+
const staticType = (type) => {
|
|
9
|
+
return target !== (0, classOf_1.classOf)(target) ? type : `${type}.static`;
|
|
10
|
+
};
|
|
11
|
+
if (typeof descriptor === "number") {
|
|
12
|
+
return propertyKey ? staticType("parameter") : "parameter.constructor";
|
|
13
|
+
}
|
|
14
|
+
if (descriptor && descriptor.value) {
|
|
15
|
+
return staticType("method");
|
|
16
|
+
}
|
|
17
|
+
if ((propertyKey && descriptor === undefined) || descriptor) {
|
|
18
|
+
return staticType("property");
|
|
19
|
+
}
|
|
20
|
+
return DecoratorTypes_1.DecoratorTypes.CLASS;
|
|
21
|
+
}
|
|
22
|
+
exports.decoratorTypeOf = decoratorTypeOf;
|
|
23
|
+
//# sourceMappingURL=decoratorTypeOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoratorTypeOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decoratorTypeOf.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAC3D,gDAA2C;AAE3C,SAAgB,eAAe,CAAC,IAAW;IACzC,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IAE/C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAO,EAAE;QACvC,OAAO,MAAM,KAAK,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,CAAC;IAC9D,CAAC,CAAC;IAEF,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,OAAO,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC;KACxE;IAED,IAAI,UAAU,IAAI,UAAU,CAAC,KAAK,EAAE;QAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;KAC7B;IAED,IAAI,CAAC,WAAW,IAAI,UAAU,KAAK,SAAS,CAAC,IAAI,UAAU,EAAE;QAC3D,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;KAC/B;IAED,OAAO,+BAAc,CAAC,KAAK,CAAC;AAC9B,CAAC;AApBD,0CAoBC","sourcesContent":["import {DecoratorTypes} from \"../../domain/DecoratorTypes\";\nimport {classOf} from \"../objects/classOf\";\n\nexport function decoratorTypeOf(args: any[]): DecoratorTypes {\n const [target, propertyKey, descriptor] = args;\n\n const staticType = (type: string): any => {\n return target !== classOf(target) ? type : `${type}.static`;\n };\n\n if (typeof descriptor === \"number\") {\n return propertyKey ? staticType(\"parameter\") : \"parameter.constructor\";\n }\n\n if (descriptor && descriptor.value) {\n return staticType(\"method\");\n }\n\n if ((propertyKey && descriptor === undefined) || descriptor) {\n return staticType(\"property\");\n }\n\n return DecoratorTypes.CLASS;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inheritedDescriptorOf = void 0;
|
|
4
|
+
const ancestorsOf_1 = require("../objects/ancestorsOf");
|
|
5
|
+
function inheritedDescriptorOf(target, propertyKey) {
|
|
6
|
+
for (const klass of (0, ancestorsOf_1.ancestorsOf)(target)) {
|
|
7
|
+
const descriptor = Object.getOwnPropertyDescriptor((klass && klass.prototype) || klass, propertyKey);
|
|
8
|
+
if (descriptor) {
|
|
9
|
+
return descriptor;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
exports.inheritedDescriptorOf = inheritedDescriptorOf;
|
|
15
|
+
//# sourceMappingURL=inheritedDescriptorOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inheritedDescriptorOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/inheritedDescriptorOf.ts"],"names":[],"mappings":";;;AAAA,wDAAmD;AAEnD,SAAgB,qBAAqB,CAAC,MAAW,EAAE,WAAmB;IACpE,KAAK,MAAM,KAAK,IAAI,IAAA,yBAAW,EAAC,MAAM,CAAC,EAAE;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,EAAE,WAAW,CAAE,CAAC;QAEtG,IAAI,UAAU,EAAE;YACd,OAAO,UAAU,CAAC;SACnB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAVD,sDAUC","sourcesContent":["import {ancestorsOf} from \"../objects/ancestorsOf\";\n\nexport function inheritedDescriptorOf(target: any, propertyKey: string): PropertyDescriptor | undefined {\n for (const klass of ancestorsOf(target)) {\n const descriptor = Object.getOwnPropertyDescriptor((klass && klass.prototype) || klass, propertyKey)!;\n\n if (descriptor) {\n return descriptor;\n }\n }\n\n return undefined;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDecorators = void 0;
|
|
4
|
+
function useDecorators(...decorators) {
|
|
5
|
+
return (...args) => {
|
|
6
|
+
decorators
|
|
7
|
+
.filter((o) => !!o)
|
|
8
|
+
.forEach((decorator) => {
|
|
9
|
+
decorator(...args);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.useDecorators = useDecorators;
|
|
14
|
+
//# sourceMappingURL=useDecorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDecorators.js","sourceRoot":"","sources":["../../../../src/utils/decorators/useDecorators.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAAC,GAAG,UAA0B;IACzD,OAAO,CAAC,GAAG,IAAyB,EAAE,EAAE;QACtC,UAAU;aACP,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aACvB,OAAO,CAAC,CAAC,SAAmB,EAAE,EAAE;YAC/B,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC;AARD,sCAQC","sourcesContent":["import {DecoratorParameters} from \"../../interfaces/DecoratorParameters\";\nimport {AnyDecorator} from \"../../interfaces/AnyDecorator\";\n\nexport function useDecorators(...decorators: AnyDecorator[]): any {\n return (...args: DecoratorParameters) => {\n decorators\n .filter((o: any) => !!o)\n .forEach((decorator: Function) => {\n decorator(...args);\n });\n };\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMethodDecorators = exports.useMethodDecorator = void 0;
|
|
4
|
+
const descriptorOf_1 = require("../objects/descriptorOf");
|
|
5
|
+
function useMethodDecorator(decorator) {
|
|
6
|
+
return (target, propertyKey) => decorator(target, propertyKey, (0, descriptorOf_1.descriptorOf)(target, propertyKey));
|
|
7
|
+
}
|
|
8
|
+
exports.useMethodDecorator = useMethodDecorator;
|
|
9
|
+
function useMethodDecorators(...decorators) {
|
|
10
|
+
return (target, propertyKey) => {
|
|
11
|
+
decorators.filter(Boolean).forEach((decorator) => decorator(target, propertyKey, (0, descriptorOf_1.descriptorOf)(target, propertyKey)));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.useMethodDecorators = useMethodDecorators;
|
|
15
|
+
//# sourceMappingURL=useMethodDecorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMethodDecorators.js","sourceRoot":"","sources":["../../../../src/utils/decorators/useMethodDecorators.ts"],"names":[],"mappings":";;;AACA,0DAAqD;AAErD,SAAgB,kBAAkB,CAAC,SAAuB;IACxD,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAC1H,CAAC;AAFD,gDAEC;AAED,SAAgB,mBAAmB,CAAC,GAAG,UAA0B;IAC/D,OAAO,CAAC,MAAW,EAAE,WAA4B,EAAE,EAAE;QACnD,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvH,CAAC,CAAC;AACJ,CAAC;AAJD,kDAIC","sourcesContent":["import {AnyDecorator} from \"../../interfaces/AnyDecorator\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\n\nexport function useMethodDecorator(decorator: AnyDecorator) {\n return (target: any, propertyKey: string | symbol) => decorator(target, propertyKey, descriptorOf(target, propertyKey));\n}\n\nexport function useMethodDecorators(...decorators: AnyDecorator[]) {\n return (target: any, propertyKey: string | symbol) => {\n decorators.filter(Boolean).forEach((decorator) => decorator(target, propertyKey, descriptorOf(target, propertyKey)));\n };\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHostInfoFromPort = void 0;
|
|
4
|
+
function getHostInfoFromPort(protocol, addressPort) {
|
|
5
|
+
let address = "0.0.0.0";
|
|
6
|
+
let port = addressPort;
|
|
7
|
+
if (typeof addressPort === "string" && addressPort.indexOf(":") > -1) {
|
|
8
|
+
[address, port] = addressPort.split(":");
|
|
9
|
+
port = +port;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
protocol,
|
|
13
|
+
address,
|
|
14
|
+
port: port,
|
|
15
|
+
toString() {
|
|
16
|
+
return [`${this.protocol}://${this.address}`, typeof this.port === "number" && this.port].filter(Boolean).join(":");
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.getHostInfoFromPort = getHostInfoFromPort;
|
|
21
|
+
//# sourceMappingURL=getHostInfoFromPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHostInfoFromPort.js","sourceRoot":"","sources":["../../../../src/utils/http/getHostInfoFromPort.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,WAAgB;IACpE,IAAI,OAAO,GAAG,SAAS,CAAC;IACxB,IAAI,IAAI,GAAG,WAAW,CAAC;IAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QACpE,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,IAAI,CAAC;KACd;IAED,OAAO;QACL,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,IAAc;QACpB,QAAQ;YACN,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtH,CAAC;KACF,CAAC;AACJ,CAAC;AAjBD,kDAiBC","sourcesContent":["export function getHostInfoFromPort(protocol: string, addressPort: any) {\n let address = \"0.0.0.0\";\n let port = addressPort;\n\n if (typeof addressPort === \"string\" && addressPort.indexOf(\":\") > -1) {\n [address, port] = addressPort.split(\":\");\n port = +port;\n }\n\n return {\n protocol,\n address,\n port: port as number,\n toString() {\n return [`${this.protocol}://${this.address}`, typeof this.port === \"number\" && this.port].filter(Boolean).join(\":\");\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.importPackage = void 0;
|
|
23
|
+
async function importPackage(packageName, loaderFn = () => Promise.resolve().then(() => __importStar(require(packageName))), optional = false) {
|
|
24
|
+
try {
|
|
25
|
+
return await loaderFn();
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (!optional) {
|
|
29
|
+
throw e;
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.importPackage = importPackage;
|
|
35
|
+
//# sourceMappingURL=importPackage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importPackage.js","sourceRoot":"","sources":["../../../../src/utils/imports/importPackage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,WAAqB,GAAG,EAAE,mDAAQ,WAAW,GAAC,EAAE,QAAQ,GAAG,KAAK;IACvH,IAAI;QACF,OAAO,MAAM,QAAQ,EAAE,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,CAAC,CAAC;SACT;QAED,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAVD,sCAUC","sourcesContent":["export async function importPackage(packageName: string, loaderFn: Function = () => import(packageName), optional = false) {\n try {\n return await loaderFn();\n } catch (e) {\n if (!optional) {\n throw e;\n }\n\n return {};\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./catchError"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./proxyDelegation"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./uniq"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./imports/importPackage"), exports);
|
|
8
|
+
// methods
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./decorators/decorateMethodsOf"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./decorators/decoratorArgs"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./decorators/decoratorTypeOf"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./objects/descriptorOf"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./decorators/inheritedDescriptorOf"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./decorators/useDecorators"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./decorators/useMethodDecorators"), exports);
|
|
16
|
+
// objects
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./objects"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./http/getHostInfoFromPort"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,iEAAkC;AAClC,sDAAuB;AACvB,uEAAwC;AAExC,UAAU;AACV,8EAA+C;AAC/C,0EAA2C;AAC3C,4EAA6C;AAC7C,sEAAuC;AACvC,kFAAmD;AACnD,0EAA2C;AAC3C,gFAAiD;AAEjD,UAAU;AACV,yDAA0B;AAC1B,0EAA2C","sourcesContent":["export * from \"./catchError\";\nexport * from \"./proxyDelegation\";\nexport * from \"./uniq\";\nexport * from \"./imports/importPackage\";\n\n// methods\nexport * from \"./decorators/decorateMethodsOf\";\nexport * from \"./decorators/decoratorArgs\";\nexport * from \"./decorators/decoratorTypeOf\";\nexport * from \"./objects/descriptorOf\";\nexport * from \"./decorators/inheritedDescriptorOf\";\nexport * from \"./decorators/useDecorators\";\nexport * from \"./decorators/useMethodDecorators\";\n\n// objects\nexport * from \"./objects\";\nexport * from \"./http/getHostInfoFromPort\";\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInheritedClass = exports.ancestorOf = void 0;
|
|
4
|
+
function ancestorOf(target) {
|
|
5
|
+
return target && Object.getPrototypeOf(target);
|
|
6
|
+
}
|
|
7
|
+
exports.ancestorOf = ancestorOf;
|
|
8
|
+
function getInheritedClass(target) {
|
|
9
|
+
return ancestorOf(target);
|
|
10
|
+
}
|
|
11
|
+
exports.getInheritedClass = getInheritedClass;
|
|
12
|
+
//# sourceMappingURL=ancestorOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ancestorOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/ancestorOf.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,MAAW;IACpC,OAAO,MAAM,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAFD,gCAEC;AAED,SAAgB,iBAAiB,CAAC,MAAW;IAC3C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAFD,8CAEC","sourcesContent":["export function ancestorOf(target: any): any {\n return target && Object.getPrototypeOf(target);\n}\n\nexport function getInheritedClass(target: any): any {\n return ancestorOf(target);\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ancestorsOf = void 0;
|
|
4
|
+
const classOf_1 = require("./classOf");
|
|
5
|
+
const ancestorOf_1 = require("./ancestorOf");
|
|
6
|
+
const nameOf_1 = require("./nameOf");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param target
|
|
10
|
+
* @returns {Array}
|
|
11
|
+
*/
|
|
12
|
+
function ancestorsOf(target) {
|
|
13
|
+
const classes = [];
|
|
14
|
+
let currentTarget = (0, classOf_1.classOf)(target);
|
|
15
|
+
while (currentTarget && (0, nameOf_1.nameOf)(currentTarget) !== "") {
|
|
16
|
+
classes.unshift(currentTarget);
|
|
17
|
+
currentTarget = (0, ancestorOf_1.getInheritedClass)(currentTarget);
|
|
18
|
+
}
|
|
19
|
+
return classes;
|
|
20
|
+
}
|
|
21
|
+
exports.ancestorsOf = ancestorsOf;
|
|
22
|
+
//# sourceMappingURL=ancestorsOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ancestorsOf.js","sourceRoot":"","sources":["../../../../src/utils/objects/ancestorsOf.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,6CAA+C;AAC/C,qCAAgC;AAEhC;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,aAAa,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,aAAa,IAAI,IAAA,eAAM,EAAC,aAAa,CAAC,KAAK,EAAE,EAAE;QACpD,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC/B,aAAa,GAAG,IAAA,8BAAiB,EAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,kCAWC","sourcesContent":["import {classOf} from \"./classOf\";\nimport {getInheritedClass} from \"./ancestorOf\";\nimport {nameOf} from \"./nameOf\";\n\n/**\n *\n * @param target\n * @returns {Array}\n */\nexport function ancestorsOf(target: any) {\n const classes = [];\n\n let currentTarget = classOf(target);\n\n while (currentTarget && nameOf(currentTarget) !== \"\") {\n classes.unshift(currentTarget);\n currentTarget = getInheritedClass(currentTarget);\n }\n\n return classes;\n}\n"]}
|