@tsed/core
Advanced tools
Comparing version 8.3.4 to 8.3.5
/*! For license information please see core.umd.min.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@tsed/core"]=e():t["@tsed/core"]=e()}(self,(()=>(()=>{var t={605:(t,e,r)=>{var n;!function(t){!function(e){var n="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),o=i(t);function i(t,e){return function(r,n){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0!==n.Reflect&&(o=i(n.Reflect,o)),function(t,e){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,a=!s&&!u,c={create:s?function(){return U(Object.create(null))}:u?function(){return U({__proto__:null})}:function(){return U({})},has:a?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:a?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},f=Object.getPrototypeOf(Function),p="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,x(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){if(!x(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(x(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function o(t,e){return e}function s(t,e){return[t,e]}}(),l="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new p}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}(),y="function"==typeof WeakMap?WeakMap:function(){var t=c.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+s()}while(c.has(t,e));return t[e]=!0,e}function o(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}function i(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(){var t=function(t){if("function"==typeof Uint8Array){var e=new Uint8Array(t);return"undefined"!=typeof crypto?crypto.getRandomValues(e):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(e):i(e,t),e}return i(new Array(t),t)}(16);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var e="",r=0;r<16;++r){var n=t[r];4!==r&&6!==r&&8!==r||(e+="-"),n<16&&(e+="0"),e+=n.toString(16).toLowerCase()}return e}}(),h=n?Symbol.for("@reflect-metadata:registry"):void 0,d=function(){var t;return!S(h)&&T(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[h]),S(t)&&(t=function(){var t,r,n,o;S(h)||void 0===e.Reflect||h in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,r=t.hasOwnMetadata,n=t.getOwnMetadata,o=t.getOwnMetadataKeys,i=t.deleteMetadata,s=new y;return{isProviderFor:function(t,e){var r=s.get(t);return!(S(r)||!r.has(e))||!!o(t,e).length&&(S(r)&&(r=new l,s.set(t,r)),r.add(e),!0)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}(e.Reflect));var i=new y,s={registerProvider:u,getProvider:c,setProvider:d};return s;function u(e){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case S(r):r=e;break;case r===e:break;case S(n):n=e;break;case n===e:break;default:void 0===o&&(o=new l),o.add(e)}}function a(e,i){if(!S(r)){if(r.isProviderFor(e,i))return r;if(!S(n)){if(n.isProviderFor(e,i))return r;if(!S(o))for(var s=N(o);;){var u=I(s);if(!u)return;var a=B(u);if(a.isProviderFor(e,i))return K(s),a}}}if(!S(t)&&t.isProviderFor(e,i))return t}function c(t,e){var r,n=i.get(t);return S(n)||(r=n.get(e)),S(r)?(S(r=a(t,e))||(S(n)&&(n=new p,i.set(t,n)),n.set(e,r)),r):r}function f(t){if(S(t))throw new TypeError;return r===t||n===t||!S(o)&&o.has(t)}function d(t,e,r){if(!f(r))throw new Error("Metadata provider not registered.");var n=c(t,e);if(n!==r){if(!S(n))return!1;var o=i.get(t);S(o)&&(o=new p,i.set(t,o)),o.set(e,r)}return!0}}()),!S(h)&&T(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),v=function(t){var e=new y,r={isProviderFor:function(t,r){var n=e.get(t);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(t,e,r,o){n(r,o,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,r){var o=n(e,r,!1);return!S(o)&&j(o.has(t))},OrdinaryGetOwnMetadata:function(t,e,r){var o=n(e,r,!1);if(!S(o))return o.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var r=[],o=n(t,e,!1);if(S(o))return r;for(var i=N(o.keys()),s=0;;){var u=I(i);if(!u)return r.length=s,r;var a=B(u);try{r[s]=a}catch(t){try{K(i)}finally{throw t}}s++}},OrdinaryDeleteMetadata:function(t,r,o){var i=n(r,o,!1);if(S(i))return!1;if(!i.delete(t))return!1;if(0===i.size){var s=e.get(r);S(s)||(s.delete(o),0===s.size&&e.delete(s))}return!0}};return d.registerProvider(r),r;function n(n,o,i){var s=e.get(n),u=!1;if(S(s)){if(!i)return;s=new p,e.set(n,s),u=!0}var a=s.get(o);if(S(a)){if(!i)return;if(a=new p,s.set(o,a),!t.setProvider(n,o,r))throw s.delete(o),u&&e.delete(n),new Error("Wrong provider for target.")}return a}}(d);function g(t,e,r){if(O(t,e,r))return!0;var n=L(e);return!P(n)&&g(t,n,r)}function O(t,e,r){var n=V(e,r,!1);return!S(n)&&j(n.OrdinaryHasOwnMetadata(t,e,r))}function w(t,e,r){if(O(t,e,r))return b(t,e,r);var n=L(e);return P(n)?void 0:w(t,n,r)}function b(t,e,r){var n=V(e,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(t,e,r)}function m(t,e,r,n){V(r,n,!0).OrdinaryDefineOwnMetadata(t,e,r,n)}function _(t,e){var r=E(t,e),n=L(t);if(null===n)return r;var o=_(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new l,s=[],u=0,a=r;u<a.length;u++){var c=a[u];i.has(c)||(i.add(c),s.push(c))}for(var f=0,p=o;f<p.length;f++)c=p[f],i.has(c)||(i.add(c),s.push(c));return s}function E(t,e){var r=V(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function M(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function S(t){return void 0===t}function P(t){return null===t}function T(t){return"object"==typeof t?null!==t:"function"==typeof t}function R(t,e){switch(M(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",n=F(t,o);if(void 0!==n){var i=n.call(t,r);if(T(i))throw new TypeError;return i}return function(t,e){if("string"===e){var r=t.toString;if(k(r)&&!T(o=r.call(t)))return o;if(k(n=t.valueOf)&&!T(o=n.call(t)))return o}else{var n;if(k(n=t.valueOf)&&!T(o=n.call(t)))return o;var o,i=t.toString;if(k(i)&&!T(o=i.call(t)))return o}throw new TypeError}(t,"default"===r?"number":r)}function j(t){return!!t}function A(t){var e=R(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function D(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function C(t){return"function"==typeof t}function x(t,e){return t===e||t!=t&&e!=e}function F(t,e){var r=t[e];if(null!=r){if(!k(r))throw new TypeError;return r}}function N(t){var e=F(t,i);if(!k(e))throw new TypeError;var r=e.call(t);if(!T(r))throw new TypeError;return r}function B(t){return t.value}function I(t){var e=t.next();return!e.done&&e}function K(t){var e=t.return;e&&e.call(t)}function L(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===f)return e;if(e!==f)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function V(t,e,r){var n=d.getProvider(t,e);if(!S(n))return n;if(r){if(d.setProvider(t,e,v))return v;throw new Error("Illegal state.")}}function U(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,n){if(S(r)){if(!D(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!S(n)&&!P(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!D(t))throw new TypeError;if(!T(e))throw new TypeError;if(!T(n)&&!S(n)&&!P(n))throw new TypeError;return P(n)&&(n=void 0),function(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!S(i)&&!P(i)){if(!T(i))throw new TypeError;n=i}}return n}(t,e,r=A(r),n)})),t("metadata",(function(t,e){return function(r,n){if(!T(r))throw new TypeError;if(!S(n)&&!function(t){switch(M(t)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;m(t,e,r,n)}})),t("defineMetadata",(function(t,e,r,n){if(!T(r))throw new TypeError;return S(n)||(n=A(n)),m(t,e,r,n)})),t("hasMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),g(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),O(t,e,r)})),t("getMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),w(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),b(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return S(e)||(e=A(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return S(e)||(e=A(e)),E(t,e)})),t("deleteMetadata",(function(t,e,r){if(!T(e))throw new TypeError;if(S(r)||(r=A(r)),!T(e))throw new TypeError;S(r)||(r=A(r));var n=V(e,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(t,e,r)}))}(o,n),void 0===n.Reflect&&(n.Reflect=t)}()}(n||(n={}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var t;function e(t){return t.prototype?t:t.constructor}function o(t){return e(t)}function i(e){const[r,n,i]=e,s=t=>r!==o(r)?t:`${t}.static`;return"number"==typeof i?n?s("parameter"):"parameter.constructor":i&&i.value?s("method"):n&&void 0===i||i?s("property"):t.CLASS}function s(t){return t===Date||t instanceof Date&&!isNaN(+t)}function u(t){return"function"==typeof t}function a(t){return null==t}function c(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function f(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function p(t){return"number"==typeof t}function l(t){return"number"==typeof t||t instanceof Number||t===Number}function y(t){return"string"==typeof t}function h(t){return"string"==typeof t||t instanceof String||t===String}function d(t){return h(t)||l(t)||f(t)}function v(t){return y(t)||p(t)||c(t)}function g(t){return[String,Number,Boolean].includes(t)}function O(t){return t instanceof RegExp}function w(t){return"symbol"==typeof t}function b(t){return"symbol"==typeof t||t instanceof Symbol||t===Symbol}r.r(n),r.d(n,{AnyToPromise:()=>rt,AnyToPromiseResponseTypes:()=>tt,AnyToPromiseStatus:()=>Z,CLASS_STORE:()=>I,DecoratorTypes:()=>t,Env:()=>et,EnvTypes:()=>nt,METHOD_STORE:()=>K,Metadata:()=>B,PARAM_STORE:()=>V,PROPERTY_STORE:()=>L,Store:()=>W,StoreFn:()=>$,StoreMerge:()=>z,StoreSet:()=>G,Type:()=>ot,UnsupportedDecoratorType:()=>it,ancestorOf:()=>at,ancestorsOf:()=>ft,catchAsyncError:()=>ut,catchError:()=>st,classOf:()=>o,cleanObject:()=>mt,constructorOf:()=>Et,createInstance:()=>_,decorateMethodsOf:()=>yt,decoratorArgs:()=>ht,decoratorTypeOf:()=>i,deepClone:()=>m,deepMerge:()=>T,descriptorOf:()=>R,getClass:()=>e,getClassOrSymbol:()=>kt,getConstructor:()=>_t,getConstructorArgNames:()=>xt,getHostInfoFromPort:()=>bt,getInheritedClass:()=>ct,getRandomId:()=>wt,getValue:()=>Ft,hasJsonMethod:()=>Nt,inheritedDescriptorOf:()=>dt,isArray:()=>Mt,isArrayOrArrayClass:()=>St,isArrowFn:()=>Pt,isBoolean:()=>c,isBooleanOrBooleanClass:()=>f,isBuffer:()=>Tt,isClass:()=>Dt,isClassObject:()=>jt,isCollection:()=>Bt,isDate:()=>s,isEmpty:()=>It,isEnumerable:()=>Kt,isFunction:()=>u,isInheritedFrom:()=>Lt,isMethodDescriptor:()=>j,isMomentObject:()=>Vt,isMongooseObject:()=>Ht,isNil:()=>a,isNumber:()=>p,isNumberOrNumberClass:()=>l,isObject:()=>J,isObjectID:()=>Ut,isObservable:()=>q,isPlainObject:()=>At,isPrimitive:()=>v,isPrimitiveClass:()=>g,isPrimitiveOrPrimitiveClass:()=>d,isPromise:()=>Y,isProtectedKey:()=>E,isRegExp:()=>O,isSerializable:()=>Wt,isStream:()=>Q,isString:()=>y,isStringOrStringClass:()=>h,isSymbol:()=>w,isSymbolOrSymbolClass:()=>b,isUint8Array:()=>Rt,mergeReducerBuilder:()=>S,methodsOf:()=>lt,nameOf:()=>k,nameOfClass:()=>A,nameOfSymbol:()=>D,objectKeys:()=>M,primitiveOf:()=>$t,prototypeOf:()=>pt,setValue:()=>zt,toMap:()=>Jt,toStringConstructor:()=>Ct,uniq:()=>qt,uniqBy:()=>Yt,useDecorators:()=>vt,useMethodDecorator:()=>gt,useMethodDecorators:()=>Ot}),function(t){t.PARAM="parameter",t.PARAM_CTOR="parameter.constructor",t.PARAM_STC="parameter.static",t.PROP="property",t.PROP_STC="property.static",t.METHOD="method",t.METHOD_STC="method.static",t.CLASS="class"}(t||(t={}));const m=(t,e=new WeakMap)=>{if((t=>a(t)||v(t)||w(t)||u(t))(t))return t;const r=e.get(t);if(r)return r;if(ArrayBuffer.isView(t))return Buffer.isBuffer(t)?Buffer.from(t):new(o(t))(t.buffer.slice(0),t.byteOffset,t.byteLength);if(s(t))return new Date(t);if(O(t))return new RegExp(t);if(Array.isArray(t)){const r=[];return e.set(t,r),t.forEach(((t,n)=>r[n]=m(t,e))),r}if(t instanceof Map){const r=new Map;return e.set(t,r),t.forEach(((t,n)=>r.set(m(n,e),m(t,e)))),r}if(t instanceof Set){const r=new Set;return e.set(t,r),t.forEach((t=>r.add(m(t,e)))),r}const n=Object.create(Reflect.getPrototypeOf(t));return e.set(t,n),Reflect.ownKeys(t).forEach((r=>{const o=Object.getOwnPropertyDescriptor(t,r);o&&(u(o.value)?Object.defineProperty(n,r,o):Object.defineProperty(n,r,{...o,value:m(o.value,e)}))})),n};function _(t){return t&&o(t)!==Object?Object.create(t):{}}function E(t){return["__proto__","constructor","prototype"].includes(t)}function M(t){return Object.keys(t).filter((t=>!E(t)))}function S(t){return(e,r,n)=>{const o=e.findIndex((e=>t(e,r)));return-1===o?[...e,r]:(e[o]=T(e[o],r,n),e)}}const P=S(((t,e)=>t===e));function T(t,e,r={}){if(function(t,e){return null==t||""===t&&""!==e}(e,t))return t;if(function(t,e){return v(t)||w(t)||u(t)||void 0===e}(e,t))return e;if(Array.isArray(t)){const n=function({reducers:t,parentKey:e}){return t?e&&t[e]?t[e]:t.default||P:P}(r);return[].concat(e).reduce(((t,e)=>n(t,e,r)),[...t])}const n=_(t);return[...M(t),...M(e)].reduce(((n,o)=>{const i=T(t&&t[o],e&&e[o],{...r,parentKey:o});return r.cleanUndefinedProps&&void 0===i||(n[o]=r.alter?.(o,i)??i),n}),n)}function R(t,e){return Reflect.getOwnPropertyDescriptor(t&&t.prototype||t,e)}function j(t,e){return R(t,e)?.value}function A(t){return"function"==typeof t?t.name:t.constructor.name}const D=t=>t.toString().replace("Symbol(","").replace(")","");function k(t){switch(typeof t){default:return""+t;case"symbol":return D(t);case"function":return A(t)}}r(605);const C="design:paramtypes",x="design:type",F="design:returntype",N=new Map;class B{static get(t,e,r){return Reflect.getMetadata(t,o(e),r)}static getOwn(t,e,r){return Reflect.getOwnMetadata(t,o(e),r)}static getType(t,e){return Reflect.getMetadata(x,t,e)}static getOwnType(t,e){return Reflect.getMetadata(x,t,e)}static getReturnType(t,e){return Reflect.getMetadata(F,t,e)}static getOwnReturnType(t,e){return Reflect.getOwnMetadata(F,t,e)}static has(t,e,r){try{return Reflect.hasMetadata(t,o(e),r)}catch(t){}return!1}static hasOwn(t,e,r){return Reflect.hasOwnMetadata(t,o(e),r)}static delete(t,e,r){return Reflect.deleteMetadata(t,o(e),r)}static setParamTypes(t,e,r){return this.set(C,r,t.prototype,e)}static{this.getTargetsFromPropertyKey=t=>N.has(t)&&N.get(t)||[]}static set(t,e,r,n){const i=N.has(t)&&N.get(t)||[],s=o(r);-1===i.indexOf(s)&&(i.push(s),N.set(t,i)),Reflect.defineMetadata(t,e,o(r),n)}static getParamTypes(t,e){return Reflect.getMetadata(C,t,e)||[]}static getOwnParamTypes(t,e){return Reflect.getOwnMetadata(C,t,e)||[]}}const I="tsed:class:store",K="tsed:method:store",L="tsed:property:store",V="tsed:param:store",U=new Map;function H(t,...e){if(w(e[0]))return U.has(e[0])||U.set(e[0],new W),U.get(e[0]);{const r=B;return r.hasOwn(t,...e)||r.set(t,new W,...e),r.getOwn(t,...e)}}class W{constructor(){this._entries=new Map}static from(...e){return function(e){const[r,n,o]=e;switch(i(e)){case t.PARAM_CTOR:case t.PARAM_STC:case t.PARAM:const e=H(V,r,n);return e.has(""+o)||e.set(""+o,new W),e.get(""+o);case t.PROP:case t.PROP_STC:return H(L,r,n);case t.METHOD:case t.METHOD_STC:return H(K,r,n);case t.CLASS:return H(I,r)}}(e)}static fromMethod(t,e){return W.from(t,e,R(t,e))}static mergeStoreFrom(t,e,...r){const n=W.from(t,...r);return W.from(e,...r)._entries.forEach(((t,e)=>{n.merge(e,t)})),n}static mergeStoreMethodFrom(t,e,r){return this.mergeStoreFrom(t,e,r,R(t,r))}get(t,e){return this._entries.get(k(t))||e}has(t){return this._entries.has(k(t))}set(t,e){return this._entries.set(k(t),e),this}delete(t){return this._entries.delete(k(t))}merge(t,e,r=!1){let n=this.get(t);return n&&(e=m(e),n=m(n),e=r?T(e,n):T(n,e)),this.set(t,e),this}toJson(){return[...this._entries.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{})}}function $(t){return(...e)=>{const r=W.from(...e),n=t(r,e);return"function"==typeof n&&n(...e),e[2]}}function z(t,e){return $((r=>{r.merge(t,e)}))}function G(t,e){return $((r=>{r.set(t,e)}))}function J(t){return"object"==typeof t}function q(t){return!!t&&"function"==typeof t.lift&&"function"==typeof t.subscribe}function Y(t){return t===Promise||t instanceof Promise||!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function X(t){return J(t)&&"data"in t&&"headers"in t&&"status"in t&&"statusText"in t}var Z,tt,et;!function(t){t.PENDING="PENDING",t.CANCELED="CANCELED",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(Z||(Z={})),function(t){t.STREAM="STREAM",t.BUFFER="BUFFER",t.DATA="DATA"}(tt||(tt={}));class rt{#t;#e;#r;#n;constructor({hasNextFunction:t=!1}={}){this.status=Z.PENDING,this.#r=!1,this.#r=t,this.#n=new Promise(((t,e)=>{this.#t=t,this.#e=e}))}isDone(){return this.status!==Z.PENDING}get next(){return this.#r=!0,t=>{if(!this.isDone())return t?this.reject(t):this.resolve({type:tt.DATA})}}call(t){if(this.isDone())return Promise.resolve(this);try{this.handle(t())}catch(t){this.reject(t)}return this.#n}reject(t){this.isDone()||(this.done(Z.REJECTED),this.#e(t))}resolve(t={}){this.isDone()||(this.done(Z.RESOLVED),this.#t({...t,state:Z.RESOLVED}))}destroy(){}cancel(){if(!this.isDone())return this.done(Z.CANCELED),this.#t({state:Z.CANCELED})}done(t){this.destroy(),this.status=t}handle(t,e={}){if(!this.isDone()){if(t){if(this.isCanceledResponse(t))return this.cancel();if(q(t)&&(t=t.toPromise()),X(t))return this.handle(t.data,{...e,status:t.status,headers:t.headers});if(Q(t))return this.resolve({...e,type:tt.STREAM,data:t});if(Q(t)||Buffer.isBuffer(t))return this.resolve({...e,type:tt.BUFFER,data:t});if(Y(t))return t.then((t=>this.handle(t,e))).catch((t=>t.response&&X(t.response)?this.handle(t.response):this.reject(t)))}return this.#r?void 0:this.resolve({...e,data:t,type:tt.DATA})}}isCanceledResponse(t){return t===Z.CANCELED}}!function(t){t.PROD="production",t.DEV="development",t.TEST="test"}(et||(et={}));const nt=et,ot=Function;r.g.Type=ot;class it extends Error{constructor(t,e){super(it.buildMessage(t,e))}static buildMessage(t,e){const[r,n,s]=e,u=i(e),a=u.split("/")[0],c="parameter"===a?".["+s+"]":"",f=n?"."+n:"parameter"===a?".constructor":"",p=k(o(r))+f+c;return`${t.name} cannot be used as ${u} decorator on ${p}`}}function st(t){try{t()}catch(t){return t}}async function ut(t){try{await t()}catch(t){return t}}function at(t){return t&&Object.getPrototypeOf(t)}function ct(t){return at(t)}function ft(t){const e=[];let r=o(t);for(;r&&""!==k(r);)e.unshift(r),r=ct(r);return e}function pt(t){return o(t)===t?t.prototype:t}function lt(t){const e=new Map;return ft(t=o(t)).forEach((t=>{Reflect.ownKeys(pt(t)).forEach((r=>{"constructor"!==r&&e.set(r,{target:t,propertyKey:r})}))})),Array.from(e.values())}function yt(t,e){lt(t).forEach((({target:r,propertyKey:n})=>{const i=pt(t);r!==o(t)&&(Object.defineProperty(i,n,{writable:!0,configurable:!0,value(...t){return pt(r)[n].apply(this,t)}}),W.mergeStoreMethodFrom(t,r,n));let s=R(t,n);const u=e(i,n,s)||s;u&&Object.defineProperty(i,n,u)}))}function ht(t,e){return[t,e,R(t,e)]}function dt(t,e){for(const r of ft(t)){const t=Object.getOwnPropertyDescriptor(r&&r.prototype||r,e);if(t)return t}}function vt(...t){return(...e)=>{const r="object"==typeof e[2];if(t.filter((t=>!!t)).forEach((t=>{const n=t(...e);r&&"object"==typeof n&&(e[2]=n)})),r)return e[2]}}function gt(t){return(e,r)=>t(e,r,R(e,r))}function Ot(...t){return(e,r)=>{t.filter(Boolean).forEach((t=>t(e,r,R(e,r))))}}function wt(){return`e${Math.random().toString(36).substring(7)}`}function bt(t,e){let r="0.0.0.0",n=e;return"string"==typeof e&&e.indexOf(":")>-1&&([r,n]=e.split(":"),n=+n),{protocol:t,address:r,port:n,toString(){return[`${this.protocol}://${this.address}`,"number"==typeof this.port&&this.port].filter(Boolean).join(":")}}}function mt(t,e=[]){return Object.entries(t).reduce(((t,[r,n])=>(E(r)||e.includes(r)||void 0===n||(t[r]=n),t)),{})}function _t(t){return"function"==typeof t?t:t.constructor}function Et(t){return _t(t)}function Mt(t){return Array.isArray(t)}function St(t){return t===Array||Mt(t)}function Pt(t){return t&&u(t)&&!t.prototype}function Tt(t){return!(!t||!("isBuffer"in t)||"function"!=typeof t.isBuffer)||Rt(t)}function Rt(t){return!(!t||!(t===Uint8Array||t instanceof Uint8Array))}function jt(t){return t===Object}function At(t){return jt(o(t))&&t!==Object}function Dt(t){return!!t&&!Pt(t)&&!(w(t)||d(t)||jt(t)||s(t)||Y(t)||St(t)||Tt(t))}function kt(t){return Dt(t)?o(t):t}function Ct(t){return`${(Et(t).toString().split("\n").find((t=>t.indexOf("constructor(")>-1))||"constructor()").replace("{","").trim()}`}function xt(t){return Ct(t).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map((t=>t.trim()))}function Ft(...t){const e=(t=>{const[e,r,n,o="."]=t;return J(r)||y(e)?{expression:e,scope:r,defaultValue:n,separator:o}:{expression:r,scope:e,defaultValue:n,separator:o}})(t);let r=e.scope;const{expression:n,defaultValue:o,separator:i}=e;if(!n)return r;if(!r)return o;const s=n.split(i),a=t=>{if(r){if(void 0!==r[t]||J(r)&&t in r)return r[t];if(u(r.get))return r.get(t)}};for(;(r=a(s.shift()))&&s.length;);return void 0===r?o:r}function Nt(t){return t&&"function"==typeof t.toJSON}function Bt(t){return St(t)||t===Map||t instanceof Map||t===Set||t instanceof Set||t===WeakMap||t instanceof WeakMap||t===WeakSet||t instanceof WeakSet}function It(t){return""===t||a(t)}function Kt(t,e){const r=o(t);if(r){const t=dt(r,e);if(t)return t.enumerable}return Object.prototype.propertyIsEnumerable.call(t,e)}function Lt(t,e,r=5){if(!t||!e)return!1;for(t=o(t),e=o(e);""!==k(t);){if(!r)return!1;if(t===e)return!0;t=at(t),r--}return!1}function Vt(t){return!(!t||!t?._isAMomentObject)}function Ut(t){return t&&t._bsontype}function Ht(t){return!!(Nt(t)&&t.$isMongooseModelPrototype||Ut(t))}function Wt(t){return!(Buffer.isBuffer(t)||Q(t)||c(t)||p(t)||y(t)||a(t))}function $t(t){return h(t)?"string":l(t)?"number":f(t)?"boolean":"any"}function zt(t,e,r,n="."){const o=e.split(n);for(;i=o.shift(),s=!o.length,!E(i)&&(s?("function"==typeof t.set?t.set(i,r):t[i]=r,0):("function"==typeof t.set?(t.has(i)||t.set(i,{}),t=t.get(i)):t=t[i]=t[i]||{},1)););var i,s}function Gt(t){return t?y(t)?e=>e[t]:t:(t,e)=>String(e)}function Jt(t,e){if(Mt(t)){const r=Gt(e||"id");return t.reduce(((t,e,n)=>([].concat(r(e,n)).forEach((r=>{const n=t.get(r);e=n?.merge?.(e)||e,t.set(r,e)})),t)),new Map)}const r=Gt(e);return Object.entries(t).reduce(((t,[e,n])=>t.set(r(n,e),n)),new Map)}function qt(t){return Array.from(new Set(t).values())}function Yt(t,e="id"){const r=new Map;return t.forEach((t=>{r.set(t[e],t)})),Array.from(r.values())}})(),n})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@tsed/core"]=e():t["@tsed/core"]=e()}(self,(()=>(()=>{var t={909:(t,e,r)=>{var n;!function(t){!function(){var e="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),n=o(t);function o(t,e){return function(r,n){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0!==e.Reflect&&(n=o(e.Reflect,n)),function(t,e){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,a=!s&&!u,c={create:s?function(){return U(Object.create(null))}:u?function(){return U({__proto__:null})}:function(){return U({})},has:a?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:a?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},f=Object.getPrototypeOf(Function),p="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,x(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){if(!x(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(x(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function o(t,e){return e}function s(t,e){return[t,e]}}(),l="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new p}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}(),y="function"==typeof WeakMap?WeakMap:function(){var t=c.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+s()}while(c.has(t,e));return t[e]=!0,e}function o(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}function i(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(){var t=function(t){if("function"==typeof Uint8Array){var e=new Uint8Array(t);return"undefined"!=typeof crypto?crypto.getRandomValues(e):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(e):i(e,t),e}return i(new Array(t),t)}(16);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var e="",r=0;r<16;++r){var n=t[r];4!==r&&6!==r&&8!==r||(e+="-"),n<16&&(e+="0"),e+=n.toString(16).toLowerCase()}return e}}(),h=n?Symbol.for("@reflect-metadata:registry"):void 0,d=function(){var t;return!S(h)&&T(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[h]),S(t)&&(t=function(){var t,r,n,o;S(h)||void 0===e.Reflect||h in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,r=t.hasOwnMetadata,n=t.getOwnMetadata,o=t.getOwnMetadataKeys,i=t.deleteMetadata,s=new y;return{isProviderFor:function(t,e){var r=s.get(t);return!(S(r)||!r.has(e))||!!o(t,e).length&&(S(r)&&(r=new l,s.set(t,r)),r.add(e),!0)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}(e.Reflect));var i=new y,s={registerProvider:u,getProvider:c,setProvider:d};return s;function u(e){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case S(r):r=e;break;case r===e:break;case S(n):n=e;break;case n===e:break;default:void 0===o&&(o=new l),o.add(e)}}function a(e,i){if(!S(r)){if(r.isProviderFor(e,i))return r;if(!S(n)){if(n.isProviderFor(e,i))return r;if(!S(o))for(var s=N(o);;){var u=I(s);if(!u)return;var a=B(u);if(a.isProviderFor(e,i))return K(s),a}}}if(!S(t)&&t.isProviderFor(e,i))return t}function c(t,e){var r,n=i.get(t);return S(n)||(r=n.get(e)),S(r)?(S(r=a(t,e))||(S(n)&&(n=new p,i.set(t,n)),n.set(e,r)),r):r}function f(t){if(S(t))throw new TypeError;return r===t||n===t||!S(o)&&o.has(t)}function d(t,e,r){if(!f(r))throw new Error("Metadata provider not registered.");var n=c(t,e);if(n!==r){if(!S(n))return!1;var o=i.get(t);S(o)&&(o=new p,i.set(t,o)),o.set(e,r)}return!0}}()),!S(h)&&T(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),v=function(t){var e=new y,r={isProviderFor:function(t,r){var n=e.get(t);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(t,e,r,o){n(r,o,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,r){var o=n(e,r,!1);return!S(o)&&j(o.has(t))},OrdinaryGetOwnMetadata:function(t,e,r){var o=n(e,r,!1);if(!S(o))return o.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var r=[],o=n(t,e,!1);if(S(o))return r;for(var i=N(o.keys()),s=0;;){var u=I(i);if(!u)return r.length=s,r;var a=B(u);try{r[s]=a}catch(t){try{K(i)}finally{throw t}}s++}},OrdinaryDeleteMetadata:function(t,r,o){var i=n(r,o,!1);if(S(i))return!1;if(!i.delete(t))return!1;if(0===i.size){var s=e.get(r);S(s)||(s.delete(o),0===s.size&&e.delete(s))}return!0}};return d.registerProvider(r),r;function n(n,o,i){var s=e.get(n),u=!1;if(S(s)){if(!i)return;s=new p,e.set(n,s),u=!0}var a=s.get(o);if(S(a)){if(!i)return;if(a=new p,s.set(o,a),!t.setProvider(n,o,r))throw s.delete(o),u&&e.delete(n),new Error("Wrong provider for target.")}return a}}(d);function g(t,e,r){if(O(t,e,r))return!0;var n=L(e);return!P(n)&&g(t,n,r)}function O(t,e,r){var n=V(e,r,!1);return!S(n)&&j(n.OrdinaryHasOwnMetadata(t,e,r))}function w(t,e,r){if(O(t,e,r))return b(t,e,r);var n=L(e);return P(n)?void 0:w(t,n,r)}function b(t,e,r){var n=V(e,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(t,e,r)}function m(t,e,r,n){V(r,n,!0).OrdinaryDefineOwnMetadata(t,e,r,n)}function _(t,e){var r=E(t,e),n=L(t);if(null===n)return r;var o=_(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new l,s=[],u=0,a=r;u<a.length;u++){var c=a[u];i.has(c)||(i.add(c),s.push(c))}for(var f=0,p=o;f<p.length;f++)c=p[f],i.has(c)||(i.add(c),s.push(c));return s}function E(t,e){var r=V(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function M(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function S(t){return void 0===t}function P(t){return null===t}function T(t){return"object"==typeof t?null!==t:"function"==typeof t}function R(t,e){switch(M(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",n=F(t,o);if(void 0!==n){var i=n.call(t,r);if(T(i))throw new TypeError;return i}return function(t,e){if("string"===e){var r=t.toString;if(k(r)&&!T(o=r.call(t)))return o;if(k(n=t.valueOf)&&!T(o=n.call(t)))return o}else{var n;if(k(n=t.valueOf)&&!T(o=n.call(t)))return o;var o,i=t.toString;if(k(i)&&!T(o=i.call(t)))return o}throw new TypeError}(t,"default"===r?"number":r)}function j(t){return!!t}function A(t){var e=R(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function D(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function C(t){return"function"==typeof t}function x(t,e){return t===e||t!=t&&e!=e}function F(t,e){var r=t[e];if(null!=r){if(!k(r))throw new TypeError;return r}}function N(t){var e=F(t,i);if(!k(e))throw new TypeError;var r=e.call(t);if(!T(r))throw new TypeError;return r}function B(t){return t.value}function I(t){var e=t.next();return!e.done&&e}function K(t){var e=t.return;e&&e.call(t)}function L(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===f)return e;if(e!==f)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function V(t,e,r){var n=d.getProvider(t,e);if(!S(n))return n;if(r){if(d.setProvider(t,e,v))return v;throw new Error("Illegal state.")}}function U(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,n){if(S(r)){if(!D(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!S(n)&&!P(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!D(t))throw new TypeError;if(!T(e))throw new TypeError;if(!T(n)&&!S(n)&&!P(n))throw new TypeError;return P(n)&&(n=void 0),function(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!S(i)&&!P(i)){if(!T(i))throw new TypeError;n=i}}return n}(t,e,r=A(r),n)})),t("metadata",(function(t,e){return function(r,n){if(!T(r))throw new TypeError;if(!S(n)&&!function(t){switch(M(t)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;m(t,e,r,n)}})),t("defineMetadata",(function(t,e,r,n){if(!T(r))throw new TypeError;return S(n)||(n=A(n)),m(t,e,r,n)})),t("hasMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),g(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),O(t,e,r)})),t("getMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),w(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!T(e))throw new TypeError;return S(r)||(r=A(r)),b(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return S(e)||(e=A(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return S(e)||(e=A(e)),E(t,e)})),t("deleteMetadata",(function(t,e,r){if(!T(e))throw new TypeError;if(S(r)||(r=A(r)),!T(e))throw new TypeError;S(r)||(r=A(r));var n=V(e,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(t,e,r)}))}(n,e),void 0===e.Reflect&&(e.Reflect=t)}()}(n||(n={}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var t;function e(t){return t.prototype?t:t.constructor}function o(t){return e(t)}function i(e){const[r,n,i]=e,s=t=>r!==o(r)?t:`${t}.static`;return"number"==typeof i?n?s("parameter"):"parameter.constructor":i&&i.value?s("method"):n&&void 0===i||i?s("property"):t.CLASS}function s(t){return t===Date||t instanceof Date&&!isNaN(+t)}function u(t){return"function"==typeof t}function a(t){return null==t}function c(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function f(t){return"boolean"==typeof t||t instanceof Boolean||t===Boolean}function p(t){return"number"==typeof t}function l(t){return"number"==typeof t||t instanceof Number||t===Number}function y(t){return"string"==typeof t}function h(t){return"string"==typeof t||t instanceof String||t===String}function d(t){return h(t)||l(t)||f(t)}function v(t){return y(t)||p(t)||c(t)}function g(t){return[String,Number,Boolean].includes(t)}function O(t){return t instanceof RegExp}function w(t){return"symbol"==typeof t}function b(t){return"symbol"==typeof t||t instanceof Symbol||t===Symbol}r.r(n),r.d(n,{AnyToPromise:()=>rt,AnyToPromiseResponseTypes:()=>tt,AnyToPromiseStatus:()=>Z,CLASS_STORE:()=>I,DecoratorTypes:()=>t,Env:()=>et,EnvTypes:()=>nt,METHOD_STORE:()=>K,Metadata:()=>B,PARAM_STORE:()=>V,PROPERTY_STORE:()=>L,Store:()=>W,StoreFn:()=>$,StoreMerge:()=>z,StoreSet:()=>G,Type:()=>ot,UnsupportedDecoratorType:()=>it,ancestorOf:()=>at,ancestorsOf:()=>ft,catchAsyncError:()=>ut,catchError:()=>st,classOf:()=>o,cleanObject:()=>mt,constructorOf:()=>Et,createInstance:()=>_,decorateMethodsOf:()=>yt,decoratorArgs:()=>ht,decoratorTypeOf:()=>i,deepClone:()=>m,deepMerge:()=>T,descriptorOf:()=>R,getClass:()=>e,getClassOrSymbol:()=>kt,getConstructor:()=>_t,getConstructorArgNames:()=>xt,getHostInfoFromPort:()=>bt,getInheritedClass:()=>ct,getRandomId:()=>wt,getValue:()=>Nt,hasJsonMethod:()=>Bt,inheritedDescriptorOf:()=>dt,isArray:()=>Mt,isArrayOrArrayClass:()=>St,isArrowFn:()=>Pt,isBoolean:()=>c,isBooleanOrBooleanClass:()=>f,isBuffer:()=>Tt,isClass:()=>Dt,isClassObject:()=>jt,isCollection:()=>It,isDate:()=>s,isEmpty:()=>Kt,isEnumerable:()=>Lt,isFunction:()=>u,isInheritedFrom:()=>Vt,isMethodDescriptor:()=>j,isMomentObject:()=>Ut,isMongooseObject:()=>Wt,isNil:()=>a,isNumber:()=>p,isNumberOrNumberClass:()=>l,isObject:()=>J,isObjectID:()=>Ht,isObservable:()=>q,isPlainObject:()=>At,isPrimitive:()=>v,isPrimitiveClass:()=>g,isPrimitiveOrPrimitiveClass:()=>d,isPromise:()=>Y,isProtectedKey:()=>E,isRegExp:()=>O,isSerializable:()=>$t,isStream:()=>Q,isString:()=>y,isStringOrStringClass:()=>h,isSymbol:()=>w,isSymbolOrSymbolClass:()=>b,isUint8Array:()=>Rt,mergeReducerBuilder:()=>S,methodsOf:()=>lt,nameOf:()=>k,nameOfClass:()=>A,nameOfSymbol:()=>D,objectKeys:()=>M,primitiveOf:()=>zt,prototypeOf:()=>pt,setValue:()=>Gt,toMap:()=>qt,toStringConstructor:()=>Ct,uniq:()=>Yt,uniqBy:()=>Qt,useDecorators:()=>vt,useMethodDecorator:()=>gt,useMethodDecorators:()=>Ot}),function(t){t.PARAM="parameter",t.PARAM_CTOR="parameter.constructor",t.PARAM_STC="parameter.static",t.PROP="property",t.PROP_STC="property.static",t.METHOD="method",t.METHOD_STC="method.static",t.CLASS="class"}(t||(t={}));const m=(t,e=new WeakMap)=>{if((t=>a(t)||v(t)||w(t)||u(t))(t))return t;const r=e.get(t);if(r)return r;if(ArrayBuffer.isView(t))return Buffer.isBuffer(t)?Buffer.from(t):new(o(t))(t.buffer.slice(0),t.byteOffset,t.byteLength);if(s(t))return new Date(t);if(O(t))return new RegExp(t);if(Array.isArray(t)){const r=[];return e.set(t,r),t.forEach(((t,n)=>r[n]=m(t,e))),r}if(t instanceof Map){const r=new Map;return e.set(t,r),t.forEach(((t,n)=>r.set(m(n,e),m(t,e)))),r}if(t instanceof Set){const r=new Set;return e.set(t,r),t.forEach((t=>r.add(m(t,e)))),r}const n=Object.create(Reflect.getPrototypeOf(t));return e.set(t,n),Reflect.ownKeys(t).forEach((r=>{const o=Object.getOwnPropertyDescriptor(t,r);o&&(u(o.value)?Object.defineProperty(n,r,o):Object.defineProperty(n,r,{...o,value:m(o.value,e)}))})),n};function _(t){return t&&o(t)!==Object?Object.create(t):{}}function E(t){return["__proto__","constructor","prototype"].includes(t)}function M(t){return Object.keys(t).filter((t=>!E(t)))}function S(t){return(e,r,n)=>{const o=e.findIndex((e=>t(e,r)));return-1===o?[...e,r]:(e[o]=T(e[o],r,n),e)}}const P=S(((t,e)=>t===e));function T(t,e,r={}){if(function(t,e){return null==t||""===t&&""!==e}(e,t))return t;if(function(t,e){return v(t)||w(t)||u(t)||void 0===e}(e,t))return e;if(Array.isArray(t)){const n=function({reducers:t,parentKey:e}){return t?e&&t[e]?t[e]:t.default||P:P}(r);return[].concat(e).reduce(((t,e)=>n(t,e,r)),[...t])}const n=_(t);return[...M(t),...M(e)].reduce(((n,o)=>{const i=T(t&&t[o],e&&e[o],{...r,parentKey:o});return r.cleanUndefinedProps&&void 0===i||(n[o]=r.alter?.(o,i)??i),n}),n)}function R(t,e){return Reflect.getOwnPropertyDescriptor(t&&t.prototype||t,e)}function j(t,e){return R(t,e)?.value}function A(t){return"function"==typeof t?t.name:t.constructor.name}const D=t=>t.toString().replace("Symbol(","").replace(")","");function k(t){switch(typeof t){default:return""+t;case"symbol":return D(t);case"function":return A(t)}}r(909);const C="design:paramtypes",x="design:type",F="design:returntype",N=new Map;class B{static get(t,e,r){return Reflect.getMetadata(t,o(e),r)}static getOwn(t,e,r){return Reflect.getOwnMetadata(t,o(e),r)}static getType(t,e){return Reflect.getMetadata(x,t,e)}static getOwnType(t,e){return Reflect.getMetadata(x,t,e)}static getReturnType(t,e){return Reflect.getMetadata(F,t,e)}static getOwnReturnType(t,e){return Reflect.getOwnMetadata(F,t,e)}static has(t,e,r){try{return Reflect.hasMetadata(t,o(e),r)}catch(t){}return!1}static hasOwn(t,e,r){return Reflect.hasOwnMetadata(t,o(e),r)}static delete(t,e,r){return Reflect.deleteMetadata(t,o(e),r)}static setParamTypes(t,e,r){return this.set(C,r,t.prototype,e)}static{this.getTargetsFromPropertyKey=t=>N.has(t)&&N.get(t)||[]}static set(t,e,r,n){const i=N.has(t)&&N.get(t)||[],s=o(r);-1===i.indexOf(s)&&(i.push(s),N.set(t,i)),Reflect.defineMetadata(t,e,o(r),n)}static getParamTypes(t,e){return Reflect.getMetadata(C,t,e)||[]}static getOwnParamTypes(t,e){return Reflect.getOwnMetadata(C,t,e)||[]}}const I="tsed:class:store",K="tsed:method:store",L="tsed:property:store",V="tsed:param:store",U=new Map;function H(t,...e){if(w(e[0]))return U.has(e[0])||U.set(e[0],new W),U.get(e[0]);{const r=B;return r.hasOwn(t,...e)||r.set(t,new W,...e),r.getOwn(t,...e)}}class W{constructor(){this._entries=new Map}static from(...e){return function(e){const[r,n,o]=e;switch(i(e)){case t.PARAM_CTOR:case t.PARAM_STC:case t.PARAM:const e=H(V,r,n);return e.has(""+o)||e.set(""+o,new W),e.get(""+o);case t.PROP:case t.PROP_STC:return H(L,r,n);case t.METHOD:case t.METHOD_STC:return H(K,r,n);case t.CLASS:return H(I,r)}}(e)}static fromMethod(t,e){return W.from(t,e,R(t,e))}static mergeStoreFrom(t,e,...r){const n=W.from(t,...r);return W.from(e,...r)._entries.forEach(((t,e)=>{n.merge(e,t)})),n}static mergeStoreMethodFrom(t,e,r){return this.mergeStoreFrom(t,e,r,R(t,r))}get(t,e){return this._entries.get(k(t))||e}has(t){return this._entries.has(k(t))}set(t,e){return this._entries.set(k(t),e),this}delete(t){return this._entries.delete(k(t))}merge(t,e,r=!1){let n=this.get(t);return n&&(e=m(e),n=m(n),e=r?T(e,n):T(n,e)),this.set(t,e),this}toJson(){return[...this._entries.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{})}}function $(t){return(...e)=>{const r=W.from(...e),n=t(r,e);return"function"==typeof n&&n(...e),e[2]}}function z(t,e){return $((r=>{r.merge(t,e)}))}function G(t,e){return $((r=>{r.set(t,e)}))}function J(t){return"object"==typeof t}function q(t){return!!t&&"function"==typeof t.lift&&"function"==typeof t.subscribe}function Y(t){return t===Promise||t instanceof Promise||!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function X(t){return J(t)&&"data"in t&&"headers"in t&&"status"in t&&"statusText"in t}var Z,tt,et;!function(t){t.PENDING="PENDING",t.CANCELED="CANCELED",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(Z||(Z={})),function(t){t.STREAM="STREAM",t.BUFFER="BUFFER",t.DATA="DATA"}(tt||(tt={}));class rt{#t;#e;#r;#n;constructor({hasNextFunction:t=!1}={}){this.status=Z.PENDING,this.#r=!1,this.#r=t,this.#n=new Promise(((t,e)=>{this.#t=t,this.#e=e}))}isDone(){return this.status!==Z.PENDING}get next(){return this.#r=!0,t=>{if(!this.isDone())return t?this.reject(t):this.resolve({type:tt.DATA})}}call(t){if(this.isDone())return Promise.resolve(this);try{this.handle(t())}catch(t){this.reject(t)}return this.#n}reject(t){this.isDone()||(this.done(Z.REJECTED),this.#e(t))}resolve(t={}){this.isDone()||(this.done(Z.RESOLVED),this.#t({...t,state:Z.RESOLVED}))}destroy(){}cancel(){if(!this.isDone())return this.done(Z.CANCELED),this.#t({state:Z.CANCELED})}done(t){this.destroy(),this.status=t}handle(t,e={}){if(!this.isDone()){if(t){if(this.isCanceledResponse(t))return this.cancel();if(q(t)&&(t=t.toPromise()),X(t))return this.handle(t.data,{...e,status:t.status,headers:t.headers});if(Q(t))return this.resolve({...e,type:tt.STREAM,data:t});if(Q(t)||Buffer.isBuffer(t))return this.resolve({...e,type:tt.BUFFER,data:t});if(Y(t))return t.then((t=>this.handle(t,e))).catch((t=>t.response&&X(t.response)?this.handle(t.response):this.reject(t)))}return this.#r?void 0:this.resolve({...e,data:t,type:tt.DATA})}}isCanceledResponse(t){return t===Z.CANCELED}}!function(t){t.PROD="production",t.DEV="development",t.TEST="test"}(et||(et={}));const nt=et,ot=Function;r.g.Type=ot;class it extends Error{constructor(t,e){super(it.buildMessage(t,e))}static buildMessage(t,e){const[r,n,s]=e,u=i(e),a=u.split("/")[0],c="parameter"===a?".["+s+"]":"",f=n?"."+n:"parameter"===a?".constructor":"",p=k(o(r))+f+c;return`${t.name} cannot be used as ${u} decorator on ${p}`}}function st(t){try{t()}catch(t){return t}}async function ut(t){try{await t()}catch(t){return t}}function at(t){return t&&Object.getPrototypeOf(t)}function ct(t){return at(t)}function ft(t){const e=[];let r=o(t);for(;r&&""!==k(r);)e.unshift(r),r=ct(r);return e}function pt(t){return o(t)===t?t.prototype:t}function lt(t){const e=new Map;return ft(t=o(t)).forEach((t=>{Reflect.ownKeys(pt(t)).forEach((r=>{"constructor"!==r&&e.set(r,{target:t,propertyKey:r})}))})),Array.from(e.values())}function yt(t,e){lt(t).forEach((({target:r,propertyKey:n})=>{const i=pt(t);r!==o(t)&&(Object.defineProperty(i,n,{writable:!0,configurable:!0,value(...t){return pt(r)[n].apply(this,t)}}),W.mergeStoreMethodFrom(t,r,n));let s=R(t,n);const u=e(i,n,s)||s;u&&Object.defineProperty(i,n,u)}))}function ht(t,e){return[t,e,R(t,e)]}function dt(t,e){for(const r of ft(t)){const t=Object.getOwnPropertyDescriptor(r&&r.prototype||r,e);if(t)return t}}function vt(...t){return(...e)=>{const r="object"==typeof e[2];if(t.filter((t=>!!t)).forEach((t=>{const n=t(...e);r&&"object"==typeof n&&(e[2]=n)})),r)return e[2]}}function gt(t){return(e,r)=>t(e,r,R(e,r))}function Ot(...t){return(e,r)=>{t.filter(Boolean).forEach((t=>t(e,r,R(e,r))))}}function wt(){return`e${Math.random().toString(36).substring(7)}`}function bt(t,e){let r="0.0.0.0",n=e;return"string"==typeof e&&e.indexOf(":")>-1&&([r,n]=e.split(":"),n=+n),{protocol:t,address:r,port:n,toString(){return[`${this.protocol}://${this.address}`,"number"==typeof this.port&&this.port].filter(Boolean).join(":")}}}function mt(t,e=[]){return Object.entries(t).reduce(((t,[r,n])=>(E(r)||e.includes(r)||void 0===n||(t[r]=n),t)),{})}function _t(t){return"function"==typeof t?t:t.constructor}function Et(t){return _t(t)}function Mt(t){return Array.isArray(t)}function St(t){return t===Array||Mt(t)}function Pt(t){return t&&u(t)&&!t.prototype}function Tt(t){return!(!t||!("isBuffer"in t)||"function"!=typeof t.isBuffer)||Rt(t)}function Rt(t){return!(!t||!(t===Uint8Array||t instanceof Uint8Array))}function jt(t){return t===Object}function At(t){return jt(o(t))&&t!==Object}function Dt(t){return!!t&&!Pt(t)&&!(w(t)||d(t)||jt(t)||s(t)||Y(t)||St(t)||Tt(t))}function kt(t){return Dt(t)?o(t):t}function Ct(t){return`${(Et(t).toString().split("\n").find((t=>t.indexOf("constructor(")>-1))||"constructor()").replace("{","").trim()}`}function xt(t){return Ct(t).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map((t=>t.trim()))}const Ft=t=>{const[e,r,n,o="."]=t;return J(r)||y(e)?{expression:e,scope:r,defaultValue:n,separator:o}:{expression:r,scope:e,defaultValue:n,separator:o}};function Nt(...t){const e=Ft(t);let r=e.scope;const{expression:n,defaultValue:o,separator:i}=e;if(!n)return r;if(!r)return o;const s=n.split(i),a=t=>{if(r){if(void 0!==r[t]||J(r)&&t in r)return r[t];if(u(r.get))return r.get(t)}};for(;(r=a(s.shift()))&&s.length;);return void 0===r?o:r}function Bt(t){return t&&"function"==typeof t.toJSON}function It(t){return St(t)||t===Map||t instanceof Map||t===Set||t instanceof Set||t===WeakMap||t instanceof WeakMap||t===WeakSet||t instanceof WeakSet}function Kt(t){return""===t||a(t)}function Lt(t,e){const r=o(t);if(r){const t=dt(r,e);if(t)return t.enumerable}return Object.prototype.propertyIsEnumerable.call(t,e)}function Vt(t,e,r=5){if(!t||!e)return!1;for(t=o(t),e=o(e);""!==k(t);){if(!r)return!1;if(t===e)return!0;t=at(t),r--}return!1}function Ut(t){return!(!t||!t?._isAMomentObject)}function Ht(t){return t&&t._bsontype}function Wt(t){return!!(Bt(t)&&t.$isMongooseModelPrototype||Ht(t))}function $t(t){return!(Buffer.isBuffer(t)||Q(t)||c(t)||p(t)||y(t)||a(t))}function zt(t){return h(t)?"string":l(t)?"number":f(t)?"boolean":"any"}function Gt(t,e,r,n="."){const o=e.split(n);for(;i=o.shift(),s=!o.length,!E(i)&&(s?("function"==typeof t.set?t.set(i,r):t[i]=r,0):("function"==typeof t.set?(t.has(i)||t.set(i,{}),t=t.get(i)):t=t[i]=t[i]||{},1)););var i,s}function Jt(t){return t?y(t)?e=>e[t]:t:(t,e)=>String(e)}function qt(t,e){if(Mt(t)){const r=Jt(e||"id");return t.reduce(((t,e,n)=>([].concat(r(e,n)).forEach((r=>{const n=t.get(r);e=n?.merge?.(e)||e,t.set(r,e)})),t)),new Map)}const r=Jt(e);return Object.entries(t).reduce(((t,[e,n])=>t.set(r(n,e),n)),new Map)}function Yt(t){return Array.from(new Set(t).values())}function Qt(t,e="id"){const r=new Map;return t.forEach((t=>{r.set(t[e],t)})),Array.from(r.values())}})(),n})())); | ||
//# sourceMappingURL=core.umd.min.js.map |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "8.3.4", | ||
"version": "8.3.5", | ||
"source": "./src/index.ts", | ||
@@ -39,6 +39,6 @@ "main": "./lib/esm/index.js", | ||
"devDependencies": { | ||
"@tsed/barrels": "8.3.4", | ||
"@tsed/barrels": "8.3.5", | ||
"@tsed/monorepo-utils": "2.3.9", | ||
"@tsed/typescript": "8.3.4", | ||
"@tsed/vitest": "8.3.4", | ||
"@tsed/typescript": "8.3.5", | ||
"@tsed/vitest": "8.3.5", | ||
"eslint": "9.12.0", | ||
@@ -45,0 +45,0 @@ "typescript": "5.4.5", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
470758