@tsed/core 8.10.0-rc.1 → 8.10.0-rc.2
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/package.json +5 -10
- package/lib/browser/core.umd.cjs +0 -15
- package/vite.config.mts +0 -22
package/package.json
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
"name": "@tsed/core",
|
|
3
3
|
"description": "Core module for Ts.ED Framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.10.0-rc.
|
|
5
|
+
"version": "8.10.0-rc.2",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
9
9
|
"typings": "./lib/types/index.d.ts",
|
|
10
|
-
"browser": "./lib/browser/core.umd.cjs",
|
|
11
10
|
"exports": {
|
|
12
11
|
".": {
|
|
13
12
|
"tsed-source": "./src/index.ts",
|
|
14
13
|
"types": "./lib/types/index.d.ts",
|
|
15
|
-
"browser": "./lib/browser/core.umd.cjs",
|
|
16
14
|
"import": "./lib/esm/index.js",
|
|
17
15
|
"default": "./lib/esm/index.js"
|
|
18
16
|
},
|
|
@@ -24,9 +22,8 @@
|
|
|
24
22
|
}
|
|
25
23
|
},
|
|
26
24
|
"scripts": {
|
|
27
|
-
"build": "yarn barrels && yarn build:ts
|
|
25
|
+
"build": "yarn barrels && yarn build:ts",
|
|
28
26
|
"barrels": "barrels",
|
|
29
|
-
"build:browser": "vite build",
|
|
30
27
|
"build:ts": "tsc --build tsconfig.esm.json",
|
|
31
28
|
"test": "vitest run",
|
|
32
29
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
@@ -36,13 +33,11 @@
|
|
|
36
33
|
"tslib": "2.7.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@tsed/barrels": "8.10.0-rc.
|
|
36
|
+
"@tsed/barrels": "8.10.0-rc.2",
|
|
40
37
|
"@tsed/monorepo-utils": "2.3.13",
|
|
41
|
-
"@tsed/typescript": "8.10.0-rc.
|
|
42
|
-
"@tsed/vitest": "8.10.0-rc.
|
|
38
|
+
"@tsed/typescript": "8.10.0-rc.2",
|
|
39
|
+
"@tsed/vitest": "8.10.0-rc.2",
|
|
43
40
|
"typescript": "5.4.5",
|
|
44
|
-
"vite": "6.2.2",
|
|
45
|
-
"vite-plugin-dts": "4.5.4",
|
|
46
41
|
"vitest": "3.1.4"
|
|
47
42
|
},
|
|
48
43
|
"peerDependencies": {},
|
package/lib/browser/core.umd.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(function(u,M){typeof exports=="object"&&typeof module<"u"?M(exports):typeof define=="function"&&define.amd?define(["exports"],M):(u=typeof globalThis<"u"?globalThis:u||self,M(u["@tsed/core"]={}))})(this,function(u){"use strict";var Nt=u=>{throw TypeError(u)};var Ft=(u,M,C)=>M.has(u)||Nt("Cannot "+C);var J=(u,M,C)=>(Ft(u,M,"read from private field"),C?C.call(u):M.get(u)),ne=(u,M,C)=>M.has(u)?Nt("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(u):M.set(u,C),U=(u,M,C,_)=>(Ft(u,M,"write to private field"),_?_.call(u,C):M.set(u,C),C);var W,X,V,K;var M=(e=>(e.PARAM="parameter",e.PARAM_CTOR="parameter.constructor",e.PARAM_STC="parameter.static",e.PROP="property",e.PROP_STC="property.static",e.METHOD="method",e.METHOD_STC="method.static",e.CLASS="class",e))(M||{});function C(e){return e.prototype?e:e.constructor}function _(e){return C(e)}function le(e){const[t,n,a]=e,o=y=>t!==_(t)?y:`${y}.static`;return typeof a=="number"?n?o("parameter"):"parameter.constructor":a&&a.value?o("method"):n&&a===void 0||a?o("property"):M.CLASS}function de(e){return e===Date||e instanceof Date&&!isNaN(+e)}function L(e){return typeof e=="function"}function re(e){return e==null}function he(e){return typeof e=="boolean"||e instanceof Boolean||e===Boolean}function ye(e){return typeof e=="boolean"||e instanceof Boolean||e===Boolean}function ve(e){return typeof e=="number"}function Oe(e){return typeof e=="number"||e instanceof Number||e===Number}function z(e){return typeof e=="string"}function we(e){return typeof e=="string"||e instanceof String||e===String}function Ge(e){return we(e)||Oe(e)||ye(e)}function me(e){return z(e)||ve(e)||he(e)}function kt(e){return[String,Number,Boolean].includes(e)}function Ve(e){return e instanceof RegExp}function H(e){return typeof e=="symbol"}function Gt(e){return typeof e=="symbol"||e instanceof Symbol||e===Symbol}const Vt=e=>re(e)||me(e)||H(e)||L(e),F=(e,t=new WeakMap)=>{if(Vt(e))return e;const n=t.get(e);if(n)return n;if(ArrayBuffer.isView(e))return Buffer.isBuffer(e)?Buffer.from(e):new(_(e))(e.buffer.slice(0),e.byteOffset,e.byteLength);if(de(e))return new Date(e);if(Ve(e))return new RegExp(e);if(Array.isArray(e)){const o=[];return t.set(e,o),e.forEach((y,m)=>o[m]=F(y,t)),o}if(e instanceof Map){const o=new Map;return t.set(e,o),e.forEach((y,m)=>o.set(F(m,t),F(y,t))),o}if(e instanceof Set){const o=new Set;return t.set(e,o),e.forEach(y=>o.add(F(y,t))),o}const a=Object.create(Reflect.getPrototypeOf(e));return t.set(e,a),Reflect.ownKeys(e).forEach(o=>{const y=Object.getOwnPropertyDescriptor(e,o);y&&(L(y.value)?Object.defineProperty(a,o,y):Object.defineProperty(a,o,{...y,value:F(y.value,t)}))}),a};function Ue(e){return e?_(e)!==Object?Object.create(e):{}:{}}function ie(e){return["__proto__","constructor","prototype"].includes(e)}function pe(e){return Object.keys(e).filter(t=>!ie(t))}function Le(e){return(t,n,a)=>{const o=t.findIndex(y=>e(y,n));return o===-1?[...t,n]:(t[o]=Y(t[o],n,a),t)}}const He=Le((e,t)=>e===t);function Ut({reducers:e,parentKey:t}){return e?t&&e[t]?e[t]:e.default||He:He}function Lt(e,t){return me(e)||H(e)||L(e)||t===void 0}function Ht(e,t){return e==null||e===""&&t!==""}function Y(e,t,n={}){if(Ht(t,e))return e;if(Lt(t,e))return t;if(Array.isArray(e)){const o=Ut(n);return[].concat(t).reduce((y,m)=>o(y,m,n),[...e])}const a=Ue(e);return[...pe(e),...pe(t)].reduce((o,y)=>{var P;const m=e&&e[y],g=Y(m,t&&t[y],{...n,parentKey:y});return n.cleanUndefinedProps&&g===void 0||(o[y]=((P=n.alter)==null?void 0:P.call(n,y,g))??g),o},a)}function k(e,t){return Reflect.getOwnPropertyDescriptor(e&&e.prototype||e,t)}function Wt(e,t){var n;return(n=k(e,t))==null?void 0:n.value}function We(e){return typeof e=="function"?e.name:e.constructor.name}const $e=e=>e.toString().replace("Symbol(","").replace(")","");function G(e){switch(typeof e){default:return""+e;case"symbol":return $e(e);case"function":return We(e)}}var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Je={};/*! *****************************************************************************
|
|
2
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
-
|
|
12
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
-
and limitations under the License.
|
|
14
|
-
***************************************************************************** */var ze;function $t(){if(ze)return Je;ze=1;var e;return function(t){(function(n){var a=typeof globalThis=="object"?globalThis:typeof qe=="object"?qe:typeof self=="object"?self:typeof this=="object"?this:P(),o=y(t);typeof a.Reflect<"u"&&(o=y(a.Reflect,o)),n(o,a),typeof a.Reflect>"u"&&(a.Reflect=t);function y(A,B){return function(j,x){Object.defineProperty(A,j,{configurable:!0,writable:!0,value:x}),B&&B(j,x)}}function m(){try{return Function("return this;")()}catch{}}function g(){try{return(0,eval)("(function() { return this; })()")}catch{}}function P(){return m()||g()}})(function(n,a){var o=Object.prototype.hasOwnProperty,y=typeof Symbol=="function",m=y&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",g=y&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",P=typeof Object.create=="function",A={__proto__:[]}instanceof Array,B=!P&&!A,j={create:P?function(){return ke(Object.create(null))}:A?function(){return ke({__proto__:null})}:function(){return ke({})},has:B?function(r,i){return o.call(r,i)}:function(r,i){return i in r},get:B?function(r,i){return o.call(r,i)?r[i]:void 0}:function(r,i){return r[i]}},x=Object.getPrototypeOf(Function),ee=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:qn(),Ie=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Jn(),Be=typeof WeakMap=="function"?WeakMap:zn(),$=y?Symbol.for("@reflect-metadata:registry"):void 0,se=Hn(),mt=Wn(se);function Sn(r,i,f,s){if(O(f)){if(!Tt(r))throw new TypeError;if(!Pt(i))throw new TypeError;return jn(r,i)}else{if(!Tt(r))throw new TypeError;if(!R(i))throw new TypeError;if(!R(s)&&!O(s)&&!q(s))throw new TypeError;return q(s)&&(s=void 0),f=N(f),Nn(r,i,f,s)}}n("decorate",Sn);function gn(r,i){function f(s,v){if(!R(s))throw new TypeError;if(!O(v)&&!Un(v))throw new TypeError;_t(r,i,s,v)}return f}n("metadata",gn);function Rn(r,i,f,s){if(!R(f))throw new TypeError;return O(s)||(s=N(s)),_t(r,i,f,s)}n("defineMetadata",Rn);function Tn(r,i,f){if(!R(i))throw new TypeError;return O(f)||(f=N(f)),pt(r,i,f)}n("hasMetadata",Tn);function Pn(r,i,f){if(!R(i))throw new TypeError;return O(f)||(f=N(f)),je(r,i,f)}n("hasOwnMetadata",Pn);function Cn(r,i,f){if(!R(i))throw new TypeError;return O(f)||(f=N(f)),Mt(r,i,f)}n("getMetadata",Cn);function An(r,i,f){if(!R(i))throw new TypeError;return O(f)||(f=N(f)),bt(r,i,f)}n("getOwnMetadata",An);function Dn(r,i){if(!R(r))throw new TypeError;return O(i)||(i=N(i)),Et(r,i)}n("getMetadataKeys",Dn);function In(r,i){if(!R(r))throw new TypeError;return O(i)||(i=N(i)),St(r,i)}n("getOwnMetadataKeys",In);function Bn(r,i,f){if(!R(i))throw new TypeError;if(O(f)||(f=N(f)),!R(i))throw new TypeError;O(f)||(f=N(f));var s=te(i,f,!1);return O(s)?!1:s.OrdinaryDeleteMetadata(r,i,f)}n("deleteMetadata",Bn);function jn(r,i){for(var f=r.length-1;f>=0;--f){var s=r[f],v=s(i);if(!O(v)&&!q(v)){if(!Pt(v))throw new TypeError;i=v}}return i}function Nn(r,i,f,s){for(var v=r.length-1;v>=0;--v){var E=r[v],T=E(i,f,s);if(!O(T)&&!q(T)){if(!R(T))throw new TypeError;s=T}}return s}function pt(r,i,f){var s=je(r,i,f);if(s)return!0;var v=Fe(i);return q(v)?!1:pt(r,v,f)}function je(r,i,f){var s=te(i,f,!1);return O(s)?!1:Rt(s.OrdinaryHasOwnMetadata(r,i,f))}function Mt(r,i,f){var s=je(r,i,f);if(s)return bt(r,i,f);var v=Fe(i);if(!q(v))return Mt(r,v,f)}function bt(r,i,f){var s=te(i,f,!1);if(!O(s))return s.OrdinaryGetOwnMetadata(r,i,f)}function _t(r,i,f,s){var v=te(f,s,!0);v.OrdinaryDefineOwnMetadata(r,i,f,s)}function Et(r,i){var f=St(r,i),s=Fe(r);if(s===null)return f;var v=Et(s,i);if(v.length<=0)return f;if(f.length<=0)return v;for(var E=new Ie,T=[],w=0,c=f;w<c.length;w++){var l=c[w],d=E.has(l);d||(E.add(l),T.push(l))}for(var h=0,p=v;h<p.length;h++){var l=p[h],d=E.has(l);d||(E.add(l),T.push(l))}return T}function St(r,i){var f=te(r,i,!1);return f?f.OrdinaryOwnMetadataKeys(r,i):[]}function gt(r){if(r===null)return 1;switch(typeof r){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return r===null?1:6;default:return 6}}function O(r){return r===void 0}function q(r){return r===null}function Fn(r){return typeof r=="symbol"}function R(r){return typeof r=="object"?r!==null:typeof r=="function"}function kn(r,i){switch(gt(r)){case 0:return r;case 1:return r;case 2:return r;case 3:return r;case 4:return r;case 5:return r}var f="string",s=Ct(r,m);if(s!==void 0){var v=s.call(r,f);if(R(v))throw new TypeError;return v}return Gn(r)}function Gn(r,i){var f,s,v;{var E=r.toString;if(ce(E)){var s=E.call(r);if(!R(s))return s}var f=r.valueOf;if(ce(f)){var s=f.call(r);if(!R(s))return s}}throw new TypeError}function Rt(r){return!!r}function Vn(r){return""+r}function N(r){var i=kn(r);return Fn(i)?i:Vn(i)}function Tt(r){return Array.isArray?Array.isArray(r):r instanceof Object?r instanceof Array:Object.prototype.toString.call(r)==="[object Array]"}function ce(r){return typeof r=="function"}function Pt(r){return typeof r=="function"}function Un(r){switch(gt(r)){case 3:return!0;case 4:return!0;default:return!1}}function Ne(r,i){return r===i||r!==r&&i!==i}function Ct(r,i){var f=r[i];if(f!=null){if(!ce(f))throw new TypeError;return f}}function At(r){var i=Ct(r,g);if(!ce(i))throw new TypeError;var f=i.call(r);if(!R(f))throw new TypeError;return f}function Dt(r){return r.value}function It(r){var i=r.next();return i.done?!1:i}function Bt(r){var i=r.return;i&&i.call(r)}function Fe(r){var i=Object.getPrototypeOf(r);if(typeof r!="function"||r===x||i!==x)return i;var f=r.prototype,s=f&&Object.getPrototypeOf(f);if(s==null||s===Object.prototype)return i;var v=s.constructor;return typeof v!="function"||v===r?i:v}function Ln(){var r;!O($)&&typeof a.Reflect<"u"&&!($ in a.Reflect)&&typeof a.Reflect.defineMetadata=="function"&&(r=$n(a.Reflect));var i,f,s,v=new Be,E={registerProvider:T,getProvider:c,setProvider:d};return E;function T(h){if(!Object.isExtensible(E))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case r===h:break;case O(i):i=h;break;case i===h:break;case O(f):f=h;break;case f===h:break;default:s===void 0&&(s=new Ie),s.add(h);break}}function w(h,p){if(!O(i)){if(i.isProviderFor(h,p))return i;if(!O(f)){if(f.isProviderFor(h,p))return i;if(!O(s))for(var b=At(s);;){var S=It(b);if(!S)return;var D=Dt(S);if(D.isProviderFor(h,p))return Bt(b),D}}}if(!O(r)&&r.isProviderFor(h,p))return r}function c(h,p){var b=v.get(h),S;return O(b)||(S=b.get(p)),O(S)&&(S=w(h,p),O(S)||(O(b)&&(b=new ee,v.set(h,b)),b.set(p,S))),S}function l(h){if(O(h))throw new TypeError;return i===h||f===h||!O(s)&&s.has(h)}function d(h,p,b){if(!l(b))throw new Error("Metadata provider not registered.");var S=c(h,p);if(S!==b){if(!O(S))return!1;var D=v.get(h);O(D)&&(D=new ee,v.set(h,D)),D.set(p,b)}return!0}}function Hn(){var r;return!O($)&&R(a.Reflect)&&Object.isExtensible(a.Reflect)&&(r=a.Reflect[$]),O(r)&&(r=Ln()),!O($)&&R(a.Reflect)&&Object.isExtensible(a.Reflect)&&Object.defineProperty(a.Reflect,$,{enumerable:!1,configurable:!1,writable:!1,value:r}),r}function Wn(r){var i=new Be,f={isProviderFor:function(l,d){var h=i.get(l);return O(h)?!1:h.has(d)},OrdinaryDefineOwnMetadata:T,OrdinaryHasOwnMetadata:v,OrdinaryGetOwnMetadata:E,OrdinaryOwnMetadataKeys:w,OrdinaryDeleteMetadata:c};return se.registerProvider(f),f;function s(l,d,h){var p=i.get(l),b=!1;if(O(p)){if(!h)return;p=new ee,i.set(l,p),b=!0}var S=p.get(d);if(O(S)){if(!h)return;if(S=new ee,p.set(d,S),!r.setProvider(l,d,f))throw p.delete(d),b&&i.delete(l),new Error("Wrong provider for target.")}return S}function v(l,d,h){var p=s(d,h,!1);return O(p)?!1:Rt(p.has(l))}function E(l,d,h){var p=s(d,h,!1);if(!O(p))return p.get(l)}function T(l,d,h,p){var b=s(h,p,!0);b.set(l,d)}function w(l,d){var h=[],p=s(l,d,!1);if(O(p))return h;for(var b=p.keys(),S=At(b),D=0;;){var jt=It(S);if(!jt)return h.length=D,h;var Yn=Dt(jt);try{h[D]=Yn}catch(Zn){try{Bt(S)}finally{throw Zn}}D++}}function c(l,d,h){var p=s(d,h,!1);if(O(p)||!p.delete(l))return!1;if(p.size===0){var b=i.get(d);O(b)||(b.delete(h),b.size===0&&i.delete(b))}return!0}}function $n(r){var i=r.defineMetadata,f=r.hasOwnMetadata,s=r.getOwnMetadata,v=r.getOwnMetadataKeys,E=r.deleteMetadata,T=new Be,w={isProviderFor:function(c,l){var d=T.get(c);return!O(d)&&d.has(l)?!0:v(c,l).length?(O(d)&&(d=new Ie,T.set(c,d)),d.add(l),!0):!1},OrdinaryDefineOwnMetadata:i,OrdinaryHasOwnMetadata:f,OrdinaryGetOwnMetadata:s,OrdinaryOwnMetadataKeys:v,OrdinaryDeleteMetadata:E};return w}function te(r,i,f){var s=se.getProvider(r,i);if(!O(s))return s;if(f){if(se.setProvider(r,i,mt))return mt;throw new Error("Illegal state.")}}function qn(){var r={},i=[],f=function(){function w(c,l,d){this._index=0,this._keys=c,this._values=l,this._selector=d}return w.prototype["@@iterator"]=function(){return this},w.prototype[g]=function(){return this},w.prototype.next=function(){var c=this._index;if(c>=0&&c<this._keys.length){var l=this._selector(this._keys[c],this._values[c]);return c+1>=this._keys.length?(this._index=-1,this._keys=i,this._values=i):this._index++,{value:l,done:!1}}return{value:void 0,done:!0}},w.prototype.throw=function(c){throw this._index>=0&&(this._index=-1,this._keys=i,this._values=i),c},w.prototype.return=function(c){return this._index>=0&&(this._index=-1,this._keys=i,this._values=i),{value:c,done:!0}},w}(),s=function(){function w(){this._keys=[],this._values=[],this._cacheKey=r,this._cacheIndex=-2}return Object.defineProperty(w.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),w.prototype.has=function(c){return this._find(c,!1)>=0},w.prototype.get=function(c){var l=this._find(c,!1);return l>=0?this._values[l]:void 0},w.prototype.set=function(c,l){var d=this._find(c,!0);return this._values[d]=l,this},w.prototype.delete=function(c){var l=this._find(c,!1);if(l>=0){for(var d=this._keys.length,h=l+1;h<d;h++)this._keys[h-1]=this._keys[h],this._values[h-1]=this._values[h];return this._keys.length--,this._values.length--,Ne(c,this._cacheKey)&&(this._cacheKey=r,this._cacheIndex=-2),!0}return!1},w.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=r,this._cacheIndex=-2},w.prototype.keys=function(){return new f(this._keys,this._values,v)},w.prototype.values=function(){return new f(this._keys,this._values,E)},w.prototype.entries=function(){return new f(this._keys,this._values,T)},w.prototype["@@iterator"]=function(){return this.entries()},w.prototype[g]=function(){return this.entries()},w.prototype._find=function(c,l){if(!Ne(this._cacheKey,c)){this._cacheIndex=-1;for(var d=0;d<this._keys.length;d++)if(Ne(this._keys[d],c)){this._cacheIndex=d;break}}return this._cacheIndex<0&&l&&(this._cacheIndex=this._keys.length,this._keys.push(c),this._values.push(void 0)),this._cacheIndex},w}();return s;function v(w,c){return w}function E(w,c){return c}function T(w,c){return[w,c]}}function Jn(){var r=function(){function i(){this._map=new ee}return Object.defineProperty(i.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),i.prototype.has=function(f){return this._map.has(f)},i.prototype.add=function(f){return this._map.set(f,f),this},i.prototype.delete=function(f){return this._map.delete(f)},i.prototype.clear=function(){this._map.clear()},i.prototype.keys=function(){return this._map.keys()},i.prototype.values=function(){return this._map.keys()},i.prototype.entries=function(){return this._map.entries()},i.prototype["@@iterator"]=function(){return this.keys()},i.prototype[g]=function(){return this.keys()},i}();return r}function zn(){var r=16,i=j.create(),f=s();return function(){function c(){this._key=s()}return c.prototype.has=function(l){var d=v(l,!1);return d!==void 0?j.has(d,this._key):!1},c.prototype.get=function(l){var d=v(l,!1);return d!==void 0?j.get(d,this._key):void 0},c.prototype.set=function(l,d){var h=v(l,!0);return h[this._key]=d,this},c.prototype.delete=function(l){var d=v(l,!1);return d!==void 0?delete d[this._key]:!1},c.prototype.clear=function(){this._key=s()},c}();function s(){var c;do c="@@WeakMap@@"+w();while(j.has(i,c));return i[c]=!0,c}function v(c,l){if(!o.call(c,f)){if(!l)return;Object.defineProperty(c,f,{value:j.create()})}return c[f]}function E(c,l){for(var d=0;d<l;++d)c[d]=Math.random()*255|0;return c}function T(c){if(typeof Uint8Array=="function"){var l=new Uint8Array(c);return typeof crypto<"u"?crypto.getRandomValues(l):typeof msCrypto<"u"?msCrypto.getRandomValues(l):E(l,c),l}return E(new Array(c),c)}function w(){var c=T(r);c[6]=c[6]&79|64,c[8]=c[8]&191|128;for(var l="",d=0;d<r;++d){var h=c[d];(d===4||d===6||d===8)&&(l+="-"),h<16&&(l+="0"),l+=h.toString(16).toLowerCase()}return l}}function ke(r){return r.__=void 0,delete r.__,r}})}(e||(e={})),Je}$t();const Me="design:paramtypes",Ye="design:type",Ze="design:returntype",Z=new Map,De=class De{static get(t,n,a){return Reflect.getMetadata(t,_(n),a)}static getOwn(t,n,a){return Reflect.getOwnMetadata(t,_(n),a)}static getType(t,n){return Reflect.getMetadata(Ye,t,n)}static getOwnType(t,n){return Reflect.getMetadata(Ye,t,n)}static getReturnType(t,n){return Reflect.getMetadata(Ze,t,n)}static getOwnReturnType(t,n){return Reflect.getOwnMetadata(Ze,t,n)}static has(t,n,a){try{return Reflect.hasMetadata(t,_(n),a)}catch{}return!1}static hasOwn(t,n,a){return Reflect.hasOwnMetadata(t,_(n),a)}static delete(t,n,a){return Reflect.deleteMetadata(t,_(n),a)}static setParamTypes(t,n,a){return this.set(Me,a,t.prototype,n)}static set(t,n,a,o){const y=Z.has(t)?Z.get(t)||[]:[],m=_(a);y.indexOf(m)===-1&&(y.push(m),Z.set(t,y)),Reflect.defineMetadata(t,n,_(a),o)}static getParamTypes(t,n){return Reflect.getMetadata(Me,t,n)||[]}static getOwnParamTypes(t,n){return Reflect.getOwnMetadata(Me,t,n)||[]}};De.getTargetsFromPropertyKey=t=>Z.has(t)?Z.get(t)||[]:[];let ae=De;const Qe="tsed:class:store",Xe="tsed:method:store",Ke="tsed:property:store",xe="tsed:param:store",be=new Map;function ue(e,...t){if(H(t[0]))return be.has(t[0])||be.set(t[0],new I),be.get(t[0]);{const n=ae;return n.hasOwn(e,...t)||n.set(e,new I,...t),n.getOwn(e,...t)}}function qt(e){const[t,n,a]=e;switch(le(e)){case M.PARAM_CTOR:case M.PARAM_STC:case M.PARAM:const o=ue(xe,t,n);return o.has(""+a)||o.set(""+a,new I),o.get(""+a);case M.PROP:case M.PROP_STC:return ue(Ke,t,n);case M.METHOD:case M.METHOD_STC:return ue(Xe,t,n);case M.CLASS:return ue(Qe,t)}}class I{constructor(){this._entries=new Map}static from(...t){return qt(t)}static fromMethod(t,n){return I.from(t,n,k(t,n))}static mergeStoreFrom(t,n,...a){const o=I.from(t,...a);return I.from(n,...a)._entries.forEach((y,m)=>{o.merge(m,y)}),o}static mergeStoreMethodFrom(t,n,a){return this.mergeStoreFrom(t,n,a,k(t,a))}get(t,n){return this._entries.get(G(t))||n}has(t){return this._entries.has(G(t))}set(t,n){return this._entries.set(G(t),n),this}delete(t){return this._entries.delete(G(t))}merge(t,n,a=!1){let o=this.get(t);return o&&(n=F(n),o=F(o),n=a?Y(n,o):Y(o,n)),this.set(t,n),this}toJson(){return[...this._entries.entries()].reduce((t,[n,a])=>({...t,[n]:a}),{})}}function _e(e){return(...t)=>{const n=I.from(...t),a=e(n,t);return typeof a=="function"&&a(...t),t[2]}}function Jt(e,t){return _e(n=>{n.merge(e,t)})}function zt(e,t){return _e(n=>{n.set(e,t)})}class Ee extends Error{constructor(t,n){super(Ee.buildMessage(t,n))}static buildMessage(t,n){const[a,o,y]=n,m=le(n),g=m.split("/")[0],P=g==="parameter"?".["+y+"]":"",B=o?"."+o:g==="parameter"?".constructor":"",j=G(_(a))+B+P;return`${t.name} cannot be used as ${m} decorator on ${j}`}}var Se=(e=>(e.PROD="production",e.DEV="development",e.TEST="test",e))(Se||{});const Yt=Se,et=Function;global.Type=et;function ge(e){return e&&Object.getPrototypeOf(e)}function tt(e){return ge(e)}function Re(e){const t=[];let n=_(e);for(;n&&G(n)!=="";)t.unshift(n),n=tt(n);return t}function fe(e){return typeof e=="object"}function nt(e){return!!e&&typeof e.lift=="function"&&typeof e.subscribe=="function"}function Te(e){return e===Promise||e instanceof Promise||!!e&&typeof e.subscribe!="function"&&typeof e.then=="function"}function oe(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function rt(e){return fe(e)&&"data"in e&&"headers"in e&&"status"in e&&"statusText"in e}var it=(e=>(e.PENDING="PENDING",e.CANCELED="CANCELED",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED",e))(it||{}),at=(e=>(e.STREAM="STREAM",e.BUFFER="BUFFER",e.DATA="DATA",e))(at||{});class Zt{constructor({hasNextFunction:t=!1}={}){ne(this,W);ne(this,X);ne(this,V);ne(this,K);this.status="PENDING",U(this,V,!1),U(this,V,t),U(this,K,new Promise((n,a)=>{U(this,W,n),U(this,X,a)}))}isDone(){return this.status!=="PENDING"}get next(){return U(this,V,!0),t=>{if(!this.isDone())return t?this.reject(t):this.resolve({type:"DATA"})}}call(t){if(this.isDone())return Promise.resolve(this);try{this.handle(t())}catch(n){this.reject(n)}return J(this,K)}reject(t){this.isDone()||(this.done("REJECTED"),J(this,X).call(this,t))}resolve(t={}){this.isDone()||(this.done("RESOLVED"),J(this,W).call(this,{...t,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),J(this,W).call(this,{state:"CANCELED"})}done(t){this.destroy(),this.status=t}handle(t,n={}){if(!this.isDone()){if(t){if(this.isCanceledResponse(t))return this.cancel();if(nt(t)&&(t=t.toPromise()),rt(t))return this.handle(t.data,{...n,status:t.status,headers:t.headers});if(oe(t))return this.resolve({...n,type:"STREAM",data:t});if(oe(t)||Buffer.isBuffer(t))return this.resolve({...n,type:"BUFFER",data:t});if(Te(t))return t.then(a=>this.handle(a,n)).catch(a=>a.response&&rt(a.response)?this.handle(a.response):this.reject(a))}if(!J(this,V))return this.resolve({...n,data:t,type:"DATA"})}}isCanceledResponse(t){return t==="CANCELED"}}W=new WeakMap,X=new WeakMap,V=new WeakMap,K=new WeakMap;function Qt(e){try{e()}catch(t){return t}}async function Xt(e){try{await e()}catch(t){return t}}function Kt(e,t=[]){return Object.entries(e).reduce((n,[a,o])=>(ie(a)||t.includes(a)||o===void 0||(n[a]=o),n),{})}function ut(e){return typeof e=="function"?e:e.constructor}function ft(e){return ut(e)}function Q(e){return _(e)===e?e.prototype:e}function ot(e){const t=new Map;return e=_(e),Re(e).forEach(n=>{Reflect.ownKeys(Q(n)).forEach(o=>{var y;H(o)||o==="constructor"||(y=Object.getOwnPropertyDescriptor(Q(n),o))!=null&&y.get||t.set(o,{target:n,propertyKey:o})})}),Array.from(t.values())}function xt(e,t){ot(e).forEach(({target:n,propertyKey:a})=>{const o=Q(e);n!==_(e)&&(Object.defineProperty(o,a,{writable:!0,configurable:!0,value(...g){return Q(n)[a].apply(this,g)}}),I.mergeStoreMethodFrom(e,n,a));let y=k(e,a);const m=t(o,a,y)||y;m&&Object.defineProperty(o,a,m)})}function en(e,t){return[e,t,k(e,t)]}function Pe(e){return Array.isArray(e)}function Ce(e){return e===Array||Pe(e)}function st(e){return e&&L(e)&&!e.prototype}function ct(e){return e&&"isBuffer"in e&&typeof e.isBuffer=="function"?!0:lt(e)}function lt(e){return!!(e&&(e===Uint8Array||e instanceof Uint8Array))}function Ae(e){return e===Object}function tn(e){return Ae(_(e))&&e!==Object}function dt(e){return!e||st(e)?!1:!(H(e)||Ge(e)||Ae(e)||de(e)||Te(e)||Ce(e)||ct(e))}function nn(e){return dt(e)?_(e):e}function ht(e){return`${(ft(e).toString().split(`
|
|
15
|
-
`).find(o=>o.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function rn(e){return ht(e).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(t=>t.trim())}function an(){return`e${Math.random().toString(36).substring(7)}`}const un=e=>{const[t,n,a,o="."]=e;return fe(n)||z(t)?{expression:t,scope:n,defaultValue:a,separator:o}:{expression:n,scope:t,defaultValue:a,separator:o}};function fn(...e){const t=un(e);let n=t.scope;const{expression:a,defaultValue:o,separator:y}=t;if(!a)return n;if(!n)return o;const m=a.split(y),g=P=>{if(n){if(n[P]!==void 0||fe(n)&&P in n)return n[P];if(L(n.get))return n.get(P)}};for(;(n=g(m.shift()))&&m.length;);return n===void 0?o:n}function yt(e){return e&&typeof e.toJSON=="function"}function on(e,t){let n="0.0.0.0",a=t;return typeof t=="string"&&t.indexOf(":")>-1&&([n,a]=t.split(":"),a=+a),{protocol:e,address:n,port:a,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function vt(e,t){for(const n of Re(e)){const a=Object.getOwnPropertyDescriptor(n&&n.prototype||n,t);if(a)return a}}function sn(e){return Ce(e)||e===Map||e instanceof Map||e===Set||e instanceof Set||e===WeakMap||e instanceof WeakMap||e===WeakSet||e instanceof WeakSet}function cn(e){return e===""||re(e)}function ln(e,t){const n=_(e);if(n){const a=vt(n,t);if(a)return a.enumerable}return Object.prototype.propertyIsEnumerable.call(e,t)}function dn(e,t,n=5){if(!e||!t)return!1;for(e=_(e),t=_(t);G(e)!=="";){if(!n)return!1;if(e===t)return!0;e=ge(e),n--}return!1}function hn(e){return!!(e&&(e!=null&&e._isAMomentObject))}function Ot(e){return e&&e._bsontype}function yn(e){return!!(yt(e)&&e.$isMongooseModelPrototype||Ot(e))}function vn(e){return!(Buffer.isBuffer(e)||oe(e)||he(e)||ve(e)||z(e)||re(e))}function On(e){return we(e)?"string":Oe(e)?"number":ye(e)?"boolean":"any"}function wn(e,t,n,a="."){const o=t.split(a),y=(m,g)=>ie(m)?!1:g?(typeof e.set=="function"?e.set(m,n):e[m]=n,!1):(typeof e.set=="function"?(e.has(m)||e.set(m,{}),e=e.get(m)):e=e[m]=e[m]||{},!0);for(;y(o.shift(),!o.length););}function wt(e){return e?z(e)?t=>t[e]:e:(t,n)=>String(n)}function mn(e,t){if(Pe(e)){const a=wt(t||"id");return e.reduce((o,y,m)=>([].concat(a(y,m)).forEach(P=>{var B;const A=o.get(P);y=((B=A==null?void 0:A.merge)==null?void 0:B.call(A,y))||y,o.set(P,y)}),o),new Map)}const n=wt(t);return Object.entries(e).reduce((a,[o,y])=>a.set(n(y,o),y),new Map)}function pn(e){return Array.from(new Set(e).values())}function Mn(e,t="id"){const n=new Map;return e.forEach(a=>{n.set(a[t],a)}),Array.from(n.values())}function bn(...e){return(...t)=>{const n=typeof t[2]=="object";if(e.filter(a=>!!a).forEach(a=>{const o=a(...t);n&&typeof o=="object"&&(t[2]=o)}),n)return t[2]}}function _n(e){return(t,n)=>e(t,n,k(t,n))}function En(...e){return(t,n)=>{e.filter(Boolean).forEach(a=>a(t,n,k(t,n)))}}u.AnyToPromise=Zt,u.AnyToPromiseResponseTypes=at,u.AnyToPromiseStatus=it,u.CLASS_STORE=Qe,u.DecoratorTypes=M,u.Env=Se,u.EnvTypes=Yt,u.METHOD_STORE=Xe,u.Metadata=ae,u.PARAM_STORE=xe,u.PROPERTY_STORE=Ke,u.Store=I,u.StoreFn=_e,u.StoreMerge=Jt,u.StoreSet=zt,u.Type=et,u.UnsupportedDecoratorType=Ee,u.ancestorOf=ge,u.ancestorsOf=Re,u.catchAsyncError=Xt,u.catchError=Qt,u.classOf=_,u.cleanObject=Kt,u.constructorOf=ft,u.createInstance=Ue,u.decorateMethodsOf=xt,u.decoratorArgs=en,u.decoratorTypeOf=le,u.deepClone=F,u.deepMerge=Y,u.descriptorOf=k,u.getClass=C,u.getClassOrSymbol=nn,u.getConstructor=ut,u.getConstructorArgNames=rn,u.getHostInfoFromPort=on,u.getInheritedClass=tt,u.getRandomId=an,u.getValue=fn,u.hasJsonMethod=yt,u.inheritedDescriptorOf=vt,u.isArray=Pe,u.isArrayOrArrayClass=Ce,u.isArrowFn=st,u.isBoolean=he,u.isBooleanOrBooleanClass=ye,u.isBuffer=ct,u.isClass=dt,u.isClassObject=Ae,u.isCollection=sn,u.isDate=de,u.isEmpty=cn,u.isEnumerable=ln,u.isFunction=L,u.isInheritedFrom=dn,u.isMethodDescriptor=Wt,u.isMomentObject=hn,u.isMongooseObject=yn,u.isNil=re,u.isNumber=ve,u.isNumberOrNumberClass=Oe,u.isObject=fe,u.isObjectID=Ot,u.isObservable=nt,u.isPlainObject=tn,u.isPrimitive=me,u.isPrimitiveClass=kt,u.isPrimitiveOrPrimitiveClass=Ge,u.isPromise=Te,u.isProtectedKey=ie,u.isRegExp=Ve,u.isSerializable=vn,u.isStream=oe,u.isString=z,u.isStringOrStringClass=we,u.isSymbol=H,u.isSymbolOrSymbolClass=Gt,u.isUint8Array=lt,u.mergeReducerBuilder=Le,u.methodsOf=ot,u.nameOf=G,u.nameOfClass=We,u.nameOfSymbol=$e,u.objectKeys=pe,u.primitiveOf=On,u.prototypeOf=Q,u.setValue=wn,u.toMap=mn,u.toStringConstructor=ht,u.uniq=pn,u.uniqBy=Mn,u.useDecorators=bn,u.useMethodDecorator=_n,u.useMethodDecorators=En,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/vite.config.mts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {defineConfig} from "vite";
|
|
2
|
-
import {resolve} from "path";
|
|
3
|
-
|
|
4
|
-
// https://vitejs.dev/config/
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [
|
|
7
|
-
// dts({
|
|
8
|
-
// outDir: "lib/browser/types",
|
|
9
|
-
// include: ["src"],
|
|
10
|
-
// exclude: ["**/*.spec.{ts,tsx}", "**/*.stories.{ts,tsx}"],
|
|
11
|
-
// })
|
|
12
|
-
],
|
|
13
|
-
build: {
|
|
14
|
-
outDir: "lib/browser",
|
|
15
|
-
lib: {
|
|
16
|
-
entry: resolve(import.meta.dirname, "src/index.ts"),
|
|
17
|
-
formats: ["umd"],
|
|
18
|
-
name: "@tsed/core",
|
|
19
|
-
fileName: "core",
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
});
|