@nestify-js/shared 0.1.4 → 0.2.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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@nestify-js/shared");const t=Symbol(`APP_LOGGER`),n=Symbol(`APP_INTERCEPTOR`),r=Symbol(`APP_FILTER`),i=Symbol(`APP_GUARD`),a=Symbol(`APP_PIPE`),o=Function.prototype.toString,s=Array.isArray,c=Object.entries,l=Object.values,u=Object.defineProperty,d=Object.assign,f=Reflect.get,p=Reflect.set,m=Reflect.has,h=Reflect.construct,g=Reflect.ownKeys,_=Reflect.getPrototypeOf;function v(e,t,...n){try{let r=e.apply(t,n);return typeof r?.then==`function`?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}let y;(function(e){e.metadata=Symbol.metadata??Symbol.for(`Symbol.metadata`),e.none=Symbol(`none`),e.root=Symbol(`root`),e.module=Symbol(`module`),e.provider=Symbol(`provider`),e.controller=Symbol(`controller`),e.injection=Symbol(`injection`);let t;(function(e){e.root=Symbol(`route`),e.base=Symbol(`base`),e.opt=Symbol(`opt`),e.apiSchema=Symbol(`apiSchema`),e.args=Symbol(`args`)})(t||=e.route||={});let n;(function(e){e.root=Symbol(`interceptor`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(n||=e.interceptor||={});let r;(function(e){e.root=Symbol(`guard`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(r||=e.guard||={});let i;(function(e){e.root=Symbol(`filter`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(i||=e.filter||={});let a;(function(e){e.root=Symbol(`pipe`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(a||=e.pipe||={});let o;(function(e){e.root=Symbol(`custom`),e.method=Symbol(`method`),e.field=Symbol(`field`)})(o||=e.custom||={}),e.cron=Symbol(`cron`),e.file=Symbol(`file`),e.user=Symbol(`user`)})(y||={});let b=function(e){return e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.EARLY_HINTS=103]=`EARLY_HINTS`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.MOVED_TEMPORARILY=302]=`MOVED_TEMPORARILY`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.REQUEST_TOO_LONG=413]=`REQUEST_TOO_LONG`,e[e.REQUEST_URI_TOO_LONG=414]=`REQUEST_URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]=`REQUESTED_RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.IM_A_TEAPOT=418]=`IM_A_TEAPOT`,e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]=`INSUFFICIENT_SPACE_ON_RESOURCE`,e[e.METHOD_FAILURE=420]=`METHOD_FAILURE`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`,e}({});const x=(...e)=>e.length===0?[]:e.filter(Array.isArray).flat(),S=(...e)=>Object.assign({},...e.filter(e=>e&&typeof e==`object`));function C(t,n){if(t===n)return!0;for(let r=(0,e._getPrototypeOf)(t);r&&r!==Function.prototype;r=(0,e._getPrototypeOf)(r))if(r===n)return!0;return!1}exports.APP_FILTER=r,exports.APP_GUARD=i,exports.APP_INTERCEPTOR=n,exports.APP_LOGGER=t,exports.APP_PIPE=a,exports.HttpStatus=b,exports._assign=d,exports._construct=h,exports._define=u,exports._entries=c,exports._fnToString=o,exports._get=f,exports._getPrototypeOf=_,exports._has=m,exports._isArray=s,exports._ownKeys=g,exports._set=p,exports._values=l,exports.concatArr=x,exports.promiseTry=v,exports.subclassOf=C,Object.defineProperty(exports,"sym",{enumerable:!0,get:function(){return y}}),exports.toAssigned=S;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return typeof e==`object`&&!!e}function t(e){return typeof e==`string`||typeof e==`symbol`}function n(e){if(typeof e!=`function`)return!1;try{return new new Proxy(e,{construct:()=>({})}),!0}catch{return!1}}function r(e){return typeof e==`function`}function i(e){return typeof e==`function`||e===void 0}function a(e){return/^[a-zA-Z0-9_-]+$/.test(e)}const o=Symbol(`APP_LOGGER`),s=Symbol(`APP_INTERCEPTOR`),c=Symbol(`APP_FILTER`),l=Symbol(`APP_GUARD`),u=Symbol(`APP_PIPE`),d=Function.prototype.toString,f=Array.isArray,p=Object.entries,m=Object.values,h=Object.defineProperty,g=Object.assign,_=Reflect.get,v=Reflect.set,y=Reflect.has,b=Reflect.construct,x=Reflect.ownKeys,S=Reflect.getPrototypeOf;function C(e,t,...n){try{let r=e.apply(t,n);return typeof r?.then==`function`?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}let w;(function(e){e.metadata=Symbol.metadata??Symbol.for(`Symbol.metadata`),e.none=Symbol(`none`),e.root=Symbol(`root`),e.module=Symbol(`module`),e.provider=Symbol(`provider`),e.controller=Symbol(`controller`),e.injection=Symbol(`injection`);let t;(function(e){e.root=Symbol(`route`),e.base=Symbol(`base`),e.opt=Symbol(`opt`),e.apiSchema=Symbol(`apiSchema`),e.args=Symbol(`args`)})(t||=e.route||={});let n;(function(e){e.root=Symbol(`interceptor`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(n||=e.interceptor||={});let r;(function(e){e.root=Symbol(`guard`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(r||=e.guard||={});let i;(function(e){e.root=Symbol(`filter`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(i||=e.filter||={});let a;(function(e){e.root=Symbol(`pipe`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(a||=e.pipe||={});let o;(function(e){e.root=Symbol(`custom`),e.method=Symbol(`method`),e.field=Symbol(`field`)})(o||=e.custom||={}),e.cron=Symbol(`cron`),e.file=Symbol(`file`),e.user=Symbol(`user`)})(w||={});let T=function(e){return e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.EARLY_HINTS=103]=`EARLY_HINTS`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.MOVED_TEMPORARILY=302]=`MOVED_TEMPORARILY`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.REQUEST_TOO_LONG=413]=`REQUEST_TOO_LONG`,e[e.REQUEST_URI_TOO_LONG=414]=`REQUEST_URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]=`REQUESTED_RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.IM_A_TEAPOT=418]=`IM_A_TEAPOT`,e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]=`INSUFFICIENT_SPACE_ON_RESOURCE`,e[e.METHOD_FAILURE=420]=`METHOD_FAILURE`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`,e}({});const E=(...e)=>e.length===0?[]:e.filter(Array.isArray).flat(),D=(...e)=>Object.assign({},...e.filter(e=>e&&typeof e==`object`));function O(e,t){if(e===t)return!0;for(let n=S(e);n&&n!==Function.prototype;n=S(n))if(n===t)return!0;return!1}exports.APP_FILTER=c,exports.APP_GUARD=l,exports.APP_INTERCEPTOR=s,exports.APP_LOGGER=o,exports.APP_PIPE=u,exports.HttpStatus=T,exports._assign=g,exports._construct=b,exports._define=h,exports._entries=p,exports._fnToString=d,exports._get=_,exports._getPrototypeOf=S,exports._has=y,exports._isArray=f,exports._isConstructable=n,exports._isFunction=r,exports._isKey=t,exports._isObject=e,exports._isPathNode=a,exports._orFunction=i,exports._ownKeys=x,exports._set=v,exports._values=m,exports.concatArr=E,exports.promiseTry=C,exports.subclassOf=O,Object.defineProperty(exports,"sym",{enumerable:!0,get:function(){return w}}),exports.toAssigned=D;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,20 @@
1
+ //#region src/types/primitive.d.ts
2
+ type OrPromise<T = void> = T | Promise<T>;
3
+ type Constructor<T = any> = new (...args: any[]) => T;
4
+ type AnyFunction = (...args: any[]) => any;
5
+ type SSKey = string | symbol;
6
+ //#endregion
7
+ //#region src/asserts.d.ts
8
+ declare function _isObject<T extends object>(o: unknown): o is T;
9
+ declare function _isKey(o: unknown): o is SSKey;
10
+ /**
11
+ * Only criterion: newable
12
+ */
13
+ declare function _isConstructable(o: any): o is Constructor;
14
+ declare function _isFunction(o: any): o is AnyFunction;
15
+ declare function _orFunction(o: any): o is AnyFunction | undefined;
16
+ declare function _isPathNode(p: string): boolean;
17
+ //#endregion
1
18
  //#region src/consts.d.ts
2
19
  declare const APP_LOGGER: unique symbol;
3
20
  declare const APP_INTERCEPTOR: unique symbol;
@@ -299,13 +316,6 @@ declare const enum HttpStatus {
299
316
  NETWORK_AUTHENTICATION_REQUIRED = 511
300
317
  }
301
318
  //#endregion
302
- //#region src/types/primitive.d.ts
303
- type Func = (...args: any[]) => any;
304
- type Constructable<T = any> = new (...args: any[]) => T;
305
- type Key = string | symbol;
306
- type Satisfied = any;
307
- type OrPromise<T = void> = T | Promise<T>;
308
- //#endregion
309
319
  //#region src/utils.d.ts
310
320
  type ArrValue<T> = T extends readonly (infer U)[] ? U : never;
311
321
  declare const concatArr: <T extends readonly unknown[]>(...args: (T | undefined)[]) => ArrValue<T>[];
@@ -316,6 +326,6 @@ declare const toAssigned: (...args: (object | symbol | undefined)[]) => any;
316
326
  * @param subClass The class to check
317
327
  * @param superClass The potential parent class
318
328
  */
319
- declare function subclassOf(subClass: Constructable, superClass: Constructable): boolean;
329
+ declare function subclassOf(subClass: new (...args: any) => any, superClass: new (...args: any) => any): boolean;
320
330
  //#endregion
321
- export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_LOGGER, APP_PIPE, type Constructable, type Func, HttpStatus, type Key, type OrPromise, type Satisfied, _assign, _construct, _define, _entries, _fnToString, _get, _getPrototypeOf, _has, _isArray, _ownKeys, _set, _values, concatArr, promiseTry, subclassOf, sym, toAssigned };
331
+ export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_LOGGER, APP_PIPE, type AnyFunction, type Constructor, HttpStatus, type OrPromise, type SSKey, _assign, _construct, _define, _entries, _fnToString, _get, _getPrototypeOf, _has, _isArray, _isConstructable, _isFunction, _isKey, _isObject, _isPathNode, _orFunction, _ownKeys, _set, _values, concatArr, promiseTry, subclassOf, sym, toAssigned };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,20 @@
1
+ //#region src/types/primitive.d.ts
2
+ type OrPromise<T = void> = T | Promise<T>;
3
+ type Constructor<T = any> = new (...args: any[]) => T;
4
+ type AnyFunction = (...args: any[]) => any;
5
+ type SSKey = string | symbol;
6
+ //#endregion
7
+ //#region src/asserts.d.ts
8
+ declare function _isObject<T extends object>(o: unknown): o is T;
9
+ declare function _isKey(o: unknown): o is SSKey;
10
+ /**
11
+ * Only criterion: newable
12
+ */
13
+ declare function _isConstructable(o: any): o is Constructor;
14
+ declare function _isFunction(o: any): o is AnyFunction;
15
+ declare function _orFunction(o: any): o is AnyFunction | undefined;
16
+ declare function _isPathNode(p: string): boolean;
17
+ //#endregion
1
18
  //#region src/consts.d.ts
2
19
  declare const APP_LOGGER: unique symbol;
3
20
  declare const APP_INTERCEPTOR: unique symbol;
@@ -299,13 +316,6 @@ declare const enum HttpStatus {
299
316
  NETWORK_AUTHENTICATION_REQUIRED = 511
300
317
  }
301
318
  //#endregion
302
- //#region src/types/primitive.d.ts
303
- type Func = (...args: any[]) => any;
304
- type Constructable<T = any> = new (...args: any[]) => T;
305
- type Key = string | symbol;
306
- type Satisfied = any;
307
- type OrPromise<T = void> = T | Promise<T>;
308
- //#endregion
309
319
  //#region src/utils.d.ts
310
320
  type ArrValue<T> = T extends readonly (infer U)[] ? U : never;
311
321
  declare const concatArr: <T extends readonly unknown[]>(...args: (T | undefined)[]) => ArrValue<T>[];
@@ -316,6 +326,6 @@ declare const toAssigned: (...args: (object | symbol | undefined)[]) => any;
316
326
  * @param subClass The class to check
317
327
  * @param superClass The potential parent class
318
328
  */
319
- declare function subclassOf(subClass: Constructable, superClass: Constructable): boolean;
329
+ declare function subclassOf(subClass: new (...args: any) => any, superClass: new (...args: any) => any): boolean;
320
330
  //#endregion
321
- export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_LOGGER, APP_PIPE, type Constructable, type Func, HttpStatus, type Key, type OrPromise, type Satisfied, _assign, _construct, _define, _entries, _fnToString, _get, _getPrototypeOf, _has, _isArray, _ownKeys, _set, _values, concatArr, promiseTry, subclassOf, sym, toAssigned };
331
+ export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_LOGGER, APP_PIPE, type AnyFunction, type Constructor, HttpStatus, type OrPromise, type SSKey, _assign, _construct, _define, _entries, _fnToString, _get, _getPrototypeOf, _has, _isArray, _isConstructable, _isFunction, _isKey, _isObject, _isPathNode, _orFunction, _ownKeys, _set, _values, concatArr, promiseTry, subclassOf, sym, toAssigned };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{_getPrototypeOf as e}from"@nestify-js/shared";const t=Symbol(`APP_LOGGER`),n=Symbol(`APP_INTERCEPTOR`),r=Symbol(`APP_FILTER`),i=Symbol(`APP_GUARD`),a=Symbol(`APP_PIPE`),o=Function.prototype.toString,s=Array.isArray,c=Object.entries,l=Object.values,u=Object.defineProperty,d=Object.assign,f=Reflect.get,p=Reflect.set,m=Reflect.has,h=Reflect.construct,g=Reflect.ownKeys,_=Reflect.getPrototypeOf;function v(e,t,...n){try{let r=e.apply(t,n);return typeof r?.then==`function`?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}let y;(function(e){e.metadata=Symbol.metadata??Symbol.for(`Symbol.metadata`),e.none=Symbol(`none`),e.root=Symbol(`root`),e.module=Symbol(`module`),e.provider=Symbol(`provider`),e.controller=Symbol(`controller`),e.injection=Symbol(`injection`);let t;(function(e){e.root=Symbol(`route`),e.base=Symbol(`base`),e.opt=Symbol(`opt`),e.apiSchema=Symbol(`apiSchema`),e.args=Symbol(`args`)})(t||=e.route||={});let n;(function(e){e.root=Symbol(`interceptor`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(n||=e.interceptor||={});let r;(function(e){e.root=Symbol(`guard`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(r||=e.guard||={});let i;(function(e){e.root=Symbol(`filter`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(i||=e.filter||={});let a;(function(e){e.root=Symbol(`pipe`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(a||=e.pipe||={});let o;(function(e){e.root=Symbol(`custom`),e.method=Symbol(`method`),e.field=Symbol(`field`)})(o||=e.custom||={}),e.cron=Symbol(`cron`),e.file=Symbol(`file`),e.user=Symbol(`user`)})(y||={});let b=function(e){return e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.EARLY_HINTS=103]=`EARLY_HINTS`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.MOVED_TEMPORARILY=302]=`MOVED_TEMPORARILY`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.REQUEST_TOO_LONG=413]=`REQUEST_TOO_LONG`,e[e.REQUEST_URI_TOO_LONG=414]=`REQUEST_URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]=`REQUESTED_RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.IM_A_TEAPOT=418]=`IM_A_TEAPOT`,e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]=`INSUFFICIENT_SPACE_ON_RESOURCE`,e[e.METHOD_FAILURE=420]=`METHOD_FAILURE`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`,e}({});const x=(...e)=>e.length===0?[]:e.filter(Array.isArray).flat(),S=(...e)=>Object.assign({},...e.filter(e=>e&&typeof e==`object`));function C(t,n){if(t===n)return!0;for(let r=e(t);r&&r!==Function.prototype;r=e(r))if(r===n)return!0;return!1}export{r as APP_FILTER,i as APP_GUARD,n as APP_INTERCEPTOR,t as APP_LOGGER,a as APP_PIPE,b as HttpStatus,d as _assign,h as _construct,u as _define,c as _entries,o as _fnToString,f as _get,_ as _getPrototypeOf,m as _has,s as _isArray,g as _ownKeys,p as _set,l as _values,x as concatArr,v as promiseTry,C as subclassOf,y as sym,S as toAssigned};
1
+ function e(e){return typeof e==`object`&&!!e}function t(e){return typeof e==`string`||typeof e==`symbol`}function n(e){if(typeof e!=`function`)return!1;try{return new new Proxy(e,{construct:()=>({})}),!0}catch{return!1}}function r(e){return typeof e==`function`}function i(e){return typeof e==`function`||e===void 0}function a(e){return/^[a-zA-Z0-9_-]+$/.test(e)}const o=Symbol(`APP_LOGGER`),s=Symbol(`APP_INTERCEPTOR`),c=Symbol(`APP_FILTER`),l=Symbol(`APP_GUARD`),u=Symbol(`APP_PIPE`),d=Function.prototype.toString,f=Array.isArray,p=Object.entries,m=Object.values,h=Object.defineProperty,g=Object.assign,_=Reflect.get,v=Reflect.set,y=Reflect.has,b=Reflect.construct,x=Reflect.ownKeys,S=Reflect.getPrototypeOf;function C(e,t,...n){try{let r=e.apply(t,n);return typeof r?.then==`function`?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}let w;(function(e){e.metadata=Symbol.metadata??Symbol.for(`Symbol.metadata`),e.none=Symbol(`none`),e.root=Symbol(`root`),e.module=Symbol(`module`),e.provider=Symbol(`provider`),e.controller=Symbol(`controller`),e.injection=Symbol(`injection`);let t;(function(e){e.root=Symbol(`route`),e.base=Symbol(`base`),e.opt=Symbol(`opt`),e.apiSchema=Symbol(`apiSchema`),e.args=Symbol(`args`)})(t||=e.route||={});let n;(function(e){e.root=Symbol(`interceptor`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(n||=e.interceptor||={});let r;(function(e){e.root=Symbol(`guard`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(r||=e.guard||={});let i;(function(e){e.root=Symbol(`filter`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(i||=e.filter||={});let a;(function(e){e.root=Symbol(`pipe`),e.controller=Symbol(`controller`),e.handler=Symbol(`handler`)})(a||=e.pipe||={});let o;(function(e){e.root=Symbol(`custom`),e.method=Symbol(`method`),e.field=Symbol(`field`)})(o||=e.custom||={}),e.cron=Symbol(`cron`),e.file=Symbol(`file`),e.user=Symbol(`user`)})(w||={});let T=function(e){return e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.EARLY_HINTS=103]=`EARLY_HINTS`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.MOVED_TEMPORARILY=302]=`MOVED_TEMPORARILY`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.REQUEST_TOO_LONG=413]=`REQUEST_TOO_LONG`,e[e.REQUEST_URI_TOO_LONG=414]=`REQUEST_URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]=`REQUESTED_RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.IM_A_TEAPOT=418]=`IM_A_TEAPOT`,e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]=`INSUFFICIENT_SPACE_ON_RESOURCE`,e[e.METHOD_FAILURE=420]=`METHOD_FAILURE`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`,e}({});const E=(...e)=>e.length===0?[]:e.filter(Array.isArray).flat(),D=(...e)=>Object.assign({},...e.filter(e=>e&&typeof e==`object`));function O(e,t){if(e===t)return!0;for(let n=S(e);n&&n!==Function.prototype;n=S(n))if(n===t)return!0;return!1}export{c as APP_FILTER,l as APP_GUARD,s as APP_INTERCEPTOR,o as APP_LOGGER,u as APP_PIPE,T as HttpStatus,g as _assign,b as _construct,h as _define,p as _entries,d as _fnToString,_ as _get,S as _getPrototypeOf,y as _has,f as _isArray,n as _isConstructable,r as _isFunction,t as _isKey,e as _isObject,a as _isPathNode,i as _orFunction,x as _ownKeys,v as _set,m as _values,E as concatArr,C as promiseTry,O as subclassOf,w as sym,D as toAssigned};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestify-js/shared",
3
- "version": "0.1.4",
3
+ "version": "0.2.2",
4
4
  "description": "Shared utilities and types for nestify-js packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",