@prostojs/mate 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,6 +58,8 @@ console.log(mate.read(MyClass, 'methodName'))
58
58
 
59
59
  ## Constructor Params Decorators
60
60
 
61
+ `params[].type` are filled from `design:paramtypes` automatically
62
+
61
63
  ```ts
62
64
  import { Mate } from '@prostojs/mate'
63
65
  const mate = new Mate('my-metadata-key')
@@ -80,6 +82,8 @@ console.log(mate.read(MyClass))
80
82
 
81
83
  ## Method Params Decorators
82
84
 
85
+ `params[].type` are filled from `design:paramtypes` automatically
86
+
83
87
  ```ts
84
88
  import { Mate } from '@prostojs/mate'
85
89
  const mate = new Mate('my-metadata-key')
@@ -112,7 +116,11 @@ interface MyMeta extends TProstoMetadata {
112
116
  n: number
113
117
  simple: boolean
114
118
  }
115
- const mate = new Mate<MyMeta>('my-metadata-key')
119
+ const mate = new Mate<MyMeta>('my-metadata-key', {
120
+ readReturnType: true, // to copy `design:returntype` -> `returnType` of metadata object
121
+ readType: true, // to copy `design:type` -> `type` of metadata object
122
+ inherit: false, // allow or disable metadata inheritance
123
+ })
116
124
 
117
125
  // Example of simple decorator
118
126
  const SimpleDecorator = mate.decorate('simple', true)
@@ -196,4 +204,47 @@ interface TMyMeta extends TProstoMetadata<TMyParamsMeta> {
196
204
 
197
205
  // pass TMyMeta to Mate constructor to define types for mate instance
198
206
  const mate = new Mate<TMyMeta>('my-metadata-key')
199
- ```
207
+ ```
208
+
209
+ ## Metadata Inheritance
210
+
211
+ It's possible to enable metadata inheritance and set some rules on whether it should be inherited from parent classes or not
212
+
213
+ ### Metadata Inheritance ON
214
+
215
+ Simply use `true` on `inherit` key to enable metadata inheritance
216
+
217
+ ```ts
218
+ const mate = new Mate<MyMeta>('my-metadata-key', {
219
+ inherit: true, // this will enable metadata inheritance for all the classes
220
+ })
221
+ ```
222
+
223
+ ### Conditional Metadata Inheritance
224
+
225
+ This example illustrates how to set a callback with logic to decide whether to inherit or not
226
+
227
+ ```ts
228
+ const mate = new Mate<MyMeta>('my-metadata-key', {
229
+ inherit(classMeta, prop, methodMeta) {
230
+ if (prop) {
231
+ // if it is a method metadata
232
+ // we require a key `inherit` to be true for inheritance
233
+ return !!methodMeta?.inherit || !!(classMeta?.inherit && !methodMeta)
234
+ }
235
+ // otherwise (in case of class metadata) we require a key `inherit`
236
+ // to be true for inheritance on class metadata
237
+ return !!classMeta?.inherit
238
+ }
239
+ })
240
+ ```
241
+
242
+ ## Use or **reflect-metadata**
243
+
244
+ It is recomended to include `reflect-metadata` dependency to rely on the original implementation. Although it's still possible to use `@prostojs/mate` with no dependency on `reflect-metadata` because it already includes its own limited implementation of reflect-metadata which ships only the features used by `@prostojs/mate` such as:
245
+
246
+ - `getOwnMetadata(key, target, prop?)`
247
+
248
+ - `defineMetadata(key, data, target, prop?)`
249
+
250
+ - `metadata(key, data)`
@@ -14,25 +14,34 @@ function panic(error) {
14
14
  }
15
15
 
16
16
  function getConstructor(instance) {
17
- return Object.getPrototypeOf(instance).constructor;
17
+ return isConstructor(instance) ?
18
+ instance : instance.constructor ?
19
+ instance.constructor : Object.getPrototypeOf(instance).constructor;
18
20
  }
19
21
  function isConstructor(v) {
20
22
  return typeof v === 'function' && Object.getOwnPropertyNames(v).includes('prototype') && !Object.getOwnPropertyNames(v).includes('caller') && !!v.name;
21
23
  }
22
24
 
23
- require('reflect-metadata');
25
+ require('./reflect');
24
26
  class Mate {
25
- constructor(workspace) {
27
+ constructor(workspace, options = {}) {
26
28
  this.workspace = workspace;
29
+ this.options = options;
27
30
  }
28
31
  set(args, key, value, isArray) {
29
32
  var _a;
30
- let meta = Reflect.getMetadata(this.workspace, args.target, args.propKey) || {};
33
+ let meta = Reflect.getOwnMetadata(this.workspace, args.target, args.propKey) || {};
34
+ if (args.propKey && this.options.readReturnType && !meta.returnType) {
35
+ meta.returnType = Reflect.getOwnMetadata('design:returntype', args.target, args.propKey);
36
+ }
37
+ if (args.propKey && this.options.readType && !meta.type) {
38
+ meta.type = Reflect.getOwnMetadata('design:type', args.target, args.propKey);
39
+ }
31
40
  const { index } = args;
32
41
  const cb = typeof key === 'function' ? key : undefined;
33
42
  let data = meta;
34
43
  if (!data.params) {
35
- data.params = (_a = Reflect.getMetadata('design:paramtypes', args.target, args.propKey)) === null || _a === void 0 ? void 0 : _a.map((f) => ({ type: f }));
44
+ data.params = (_a = Reflect.getOwnMetadata('design:paramtypes', args.target, args.propKey)) === null || _a === void 0 ? void 0 : _a.map((f) => ({ type: f }));
36
45
  }
37
46
  if (typeof index === 'number') {
38
47
  data.params = data.params || [];
@@ -65,7 +74,31 @@ class Mate {
65
74
  Reflect.defineMetadata(this.workspace, meta, args.target, args.propKey);
66
75
  }
67
76
  read(target, propKey) {
68
- return Reflect.getMetadata(this.workspace, typeof propKey === 'string' ? isConstructor(target) ? target.prototype : target : isConstructor(target) ? target : getConstructor(target), propKey);
77
+ const isConstr = isConstructor(target);
78
+ const constructor = isConstr ? target : getConstructor(target);
79
+ const proto = constructor.prototype;
80
+ let ownMeta = Reflect.getOwnMetadata(this.workspace, typeof propKey === 'string' ? proto : constructor, propKey);
81
+ if (this.options.inherit) {
82
+ const inheritFn = typeof this.options.inherit === 'function' ? this.options.inherit : undefined;
83
+ let shouldInherit = this.options.inherit;
84
+ if (inheritFn) {
85
+ if (typeof propKey === 'string') {
86
+ const classMeta = Reflect.getOwnMetadata(this.workspace, constructor);
87
+ shouldInherit = inheritFn(classMeta, propKey, ownMeta);
88
+ }
89
+ else {
90
+ shouldInherit = inheritFn(ownMeta);
91
+ }
92
+ }
93
+ if (shouldInherit) {
94
+ const parent = Object.getPrototypeOf(constructor);
95
+ if (typeof parent === 'function' && parent !== fnProto && parent !== constructor) {
96
+ const inheritedMeta = this.read(parent, propKey);
97
+ ownMeta = { ...inheritedMeta, ...ownMeta, params: ownMeta === null || ownMeta === void 0 ? void 0 : ownMeta.params };
98
+ }
99
+ }
100
+ }
101
+ return ownMeta;
69
102
  }
70
103
  apply(...decorators) {
71
104
  return ((target, propKey, descriptor) => {
@@ -85,6 +118,9 @@ class Mate {
85
118
  this.set(args, key, value, isArray);
86
119
  });
87
120
  }
88
- }
121
+ }
122
+ const fnProto = Object.getPrototypeOf(Function);
89
123
 
90
124
  exports.Mate = Mate;
125
+ exports.getConstructor = getConstructor;
126
+ exports.isConstructor = isConstructor;
package/dist/mate.d.ts CHANGED
@@ -1,10 +1,15 @@
1
+ export declare function getConstructor<T = TAny>(instance: T): TFunction;
2
+
3
+ export declare function isConstructor<T = TAny>(v: T): v is (T & TClassConstructor);
4
+
1
5
  export declare class Mate<T extends TProstoMetadata = TProstoMetadata> {
2
6
  protected workspace: string;
3
- constructor(workspace: string);
7
+ protected options: TMateOptions<T>;
8
+ constructor(workspace: string, options?: TMateOptions<T>);
4
9
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, cb: ((meta: R & RP) => R & RP)): void;
5
10
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): void;
6
11
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined, isArray: boolean | undefined): void;
7
- read<R = T>(target: TFunction | TObject, propKey?: string | symbol): R | undefined;
12
+ read<R extends T = T>(target: TFunction | TObject, propKey?: string | symbol): R | undefined;
8
13
  apply(...decorators: (MethodDecorator & ClassDecorator & ParameterDecorator)[]): MethodDecorator & ClassDecorator & ParameterDecorator;
9
14
  decorate<R extends T = T, RP = R['params'][0]>(cb: ((meta: R & RP) => R & RP)): MethodDecorator & ClassDecorator & ParameterDecorator;
10
15
  decorate<R extends T = T, RP = R['params'][0]>(key: keyof R | keyof RP | ((meta: R & RP) => R & RP), value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): MethodDecorator & ClassDecorator & ParameterDecorator;
@@ -13,8 +18,16 @@ export declare class Mate<T extends TProstoMetadata = TProstoMetadata> {
13
18
 
14
19
  declare type TAny = any;
15
20
 
21
+ declare type TClassConstructor<T = unknown> = new (...args: TAny[]) => T;
22
+
16
23
  declare type TFunction = Function;
17
24
 
25
+ export declare interface TMateOptions<T extends TProstoMetadata = TProstoMetadata> {
26
+ readReturnType?: boolean;
27
+ readType?: boolean;
28
+ inherit?: boolean | ((classMeta: T, propKey?: string, methodMeta?: T) => boolean);
29
+ }
30
+
18
31
  export declare interface TMergedDecoratorArgs {
19
32
  target: TFunction | TObject;
20
33
  propKey?: string | symbol;
@@ -26,10 +39,12 @@ declare type TObject = object;
26
39
 
27
40
  export declare interface TProstoMetadata<TParams extends TProstoParamsMetadata = TProstoParamsMetadata> {
28
41
  params: TParams[];
42
+ type?: TFunction;
43
+ returnType?: TFunction;
29
44
  }
30
45
 
31
46
  export declare interface TProstoParamsMetadata {
32
- type: TFunction;
47
+ type?: TFunction;
33
48
  }
34
49
 
35
50
  export { }
@@ -1 +1 @@
1
- function e(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function t(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");class r{constructor(e){this.workspace=e}set(t,r,a,o){var p;let s=Reflect.getMetadata(this.workspace,t.target,t.propKey)||{};const{index:n}=t,c="function"==typeof r?r:void 0;let i=s;if(i.params||(i.params=null===(p=Reflect.getMetadata("design:paramtypes",t.target,t.propKey))||void 0===p?void 0:p.map((e=>({type:e})))),"number"==typeof n&&(i.params=i.params||[],i.params[n]=i.params[n]||{type:void 0},c?i.params[n]=c(i.params[n]):i=i.params[n]),"function"!=typeof r)if(o){const t=i[r]||[];Array.isArray(t)||(e(f="Mate.add (isArray=true) called for non-array metadata"),new Error(f)),t.unshift(a),i[r]=t}else i[r]=a;else c&&"number"!=typeof n&&(s=c(i));var f;Reflect.defineMetadata(this.workspace,s,t.target,t.propKey)}read(e,r){return Reflect.getMetadata(this.workspace,"string"==typeof r?t(e)?e.prototype:e:t(e)?e:Object.getPrototypeOf(e).constructor,r)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,p)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof p?void 0:p,index:"number"==typeof p?p:void 0},e,t,r)}}}export{r as Mate};
1
+ function t(t){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+t+"")}function e(t){return r(t)?t:t.constructor?t.constructor:Object.getPrototypeOf(t).constructor}function r(t){return"function"==typeof t&&Object.getOwnPropertyNames(t).includes("prototype")&&!Object.getOwnPropertyNames(t).includes("caller")&&!!t.name}require("./reflect");class o{constructor(t,e={}){this.workspace=t,this.options=e}set(e,r,o,a){var n;let p=Reflect.getOwnMetadata(this.workspace,e.target,e.propKey)||{};e.propKey&&this.options.readReturnType&&!p.returnType&&(p.returnType=Reflect.getOwnMetadata("design:returntype",e.target,e.propKey)),e.propKey&&this.options.readType&&!p.type&&(p.type=Reflect.getOwnMetadata("design:type",e.target,e.propKey));const{index:s}=e,i="function"==typeof r?r:void 0;let c=p;if(c.params||(c.params=null===(n=Reflect.getOwnMetadata("design:paramtypes",e.target,e.propKey))||void 0===n?void 0:n.map((t=>({type:t})))),"number"==typeof s&&(c.params=c.params||[],c.params[s]=c.params[s]||{type:void 0},i?c.params[s]=i(c.params[s]):c=c.params[s]),"function"!=typeof r)if(a){const e=c[r]||[];Array.isArray(e)||(t(f="Mate.add (isArray=true) called for non-array metadata"),new Error(f)),e.unshift(o),c[r]=e}else c[r]=o;else i&&"number"!=typeof s&&(p=i(c));var f;Reflect.defineMetadata(this.workspace,p,e.target,e.propKey)}read(t,o){const n=r(t)?t:e(t);let p=Reflect.getOwnMetadata(this.workspace,"string"==typeof o?n.prototype:n,o);if(this.options.inherit){const t="function"==typeof this.options.inherit?this.options.inherit:void 0;let e=this.options.inherit;if(t)if("string"==typeof o){e=t(Reflect.getOwnMetadata(this.workspace,n),o,p)}else e=t(p);if(e){const t=Object.getPrototypeOf(n);if("function"==typeof t&&t!==a&&t!==n){p={...this.read(t,o),...p,params:null==p?void 0:p.params}}}}return p}apply(...t){return(e,r,o)=>{for(const a of t)a(e,r,o)}}decorate(t,e,r){return(o,a,n)=>{this.set({target:o,propKey:a,descriptor:"number"==typeof n?void 0:n,index:"number"==typeof n?n:void 0},t,e,r)}}}const a=Object.getPrototypeOf(Function);export{o as Mate,e as getConstructor,r as isConstructor};
@@ -10,25 +10,34 @@ function panic(error) {
10
10
  }
11
11
 
12
12
  function getConstructor(instance) {
13
- return Object.getPrototypeOf(instance).constructor;
13
+ return isConstructor(instance) ?
14
+ instance : instance.constructor ?
15
+ instance.constructor : Object.getPrototypeOf(instance).constructor;
14
16
  }
15
17
  function isConstructor(v) {
16
18
  return typeof v === 'function' && Object.getOwnPropertyNames(v).includes('prototype') && !Object.getOwnPropertyNames(v).includes('caller') && !!v.name;
17
19
  }
18
20
 
19
- require('reflect-metadata');
21
+ require('./reflect');
20
22
  class Mate {
21
- constructor(workspace) {
23
+ constructor(workspace, options = {}) {
22
24
  this.workspace = workspace;
25
+ this.options = options;
23
26
  }
24
27
  set(args, key, value, isArray) {
25
28
  var _a;
26
- let meta = Reflect.getMetadata(this.workspace, args.target, args.propKey) || {};
29
+ let meta = Reflect.getOwnMetadata(this.workspace, args.target, args.propKey) || {};
30
+ if (args.propKey && this.options.readReturnType && !meta.returnType) {
31
+ meta.returnType = Reflect.getOwnMetadata('design:returntype', args.target, args.propKey);
32
+ }
33
+ if (args.propKey && this.options.readType && !meta.type) {
34
+ meta.type = Reflect.getOwnMetadata('design:type', args.target, args.propKey);
35
+ }
27
36
  const { index } = args;
28
37
  const cb = typeof key === 'function' ? key : undefined;
29
38
  let data = meta;
30
39
  if (!data.params) {
31
- data.params = (_a = Reflect.getMetadata('design:paramtypes', args.target, args.propKey)) === null || _a === void 0 ? void 0 : _a.map((f) => ({ type: f }));
40
+ data.params = (_a = Reflect.getOwnMetadata('design:paramtypes', args.target, args.propKey)) === null || _a === void 0 ? void 0 : _a.map((f) => ({ type: f }));
32
41
  }
33
42
  if (typeof index === 'number') {
34
43
  data.params = data.params || [];
@@ -61,7 +70,31 @@ class Mate {
61
70
  Reflect.defineMetadata(this.workspace, meta, args.target, args.propKey);
62
71
  }
63
72
  read(target, propKey) {
64
- return Reflect.getMetadata(this.workspace, typeof propKey === 'string' ? isConstructor(target) ? target.prototype : target : isConstructor(target) ? target : getConstructor(target), propKey);
73
+ const isConstr = isConstructor(target);
74
+ const constructor = isConstr ? target : getConstructor(target);
75
+ const proto = constructor.prototype;
76
+ let ownMeta = Reflect.getOwnMetadata(this.workspace, typeof propKey === 'string' ? proto : constructor, propKey);
77
+ if (this.options.inherit) {
78
+ const inheritFn = typeof this.options.inherit === 'function' ? this.options.inherit : undefined;
79
+ let shouldInherit = this.options.inherit;
80
+ if (inheritFn) {
81
+ if (typeof propKey === 'string') {
82
+ const classMeta = Reflect.getOwnMetadata(this.workspace, constructor);
83
+ shouldInherit = inheritFn(classMeta, propKey, ownMeta);
84
+ }
85
+ else {
86
+ shouldInherit = inheritFn(ownMeta);
87
+ }
88
+ }
89
+ if (shouldInherit) {
90
+ const parent = Object.getPrototypeOf(constructor);
91
+ if (typeof parent === 'function' && parent !== fnProto && parent !== constructor) {
92
+ const inheritedMeta = this.read(parent, propKey);
93
+ ownMeta = { ...inheritedMeta, ...ownMeta, params: ownMeta === null || ownMeta === void 0 ? void 0 : ownMeta.params };
94
+ }
95
+ }
96
+ }
97
+ return ownMeta;
65
98
  }
66
99
  apply(...decorators) {
67
100
  return ((target, propKey, descriptor) => {
@@ -81,6 +114,7 @@ class Mate {
81
114
  this.set(args, key, value, isArray);
82
115
  });
83
116
  }
84
- }
117
+ }
118
+ const fnProto = Object.getPrototypeOf(Function);
85
119
 
86
- export { Mate };
120
+ export { Mate, getConstructor, isConstructor };
@@ -1 +1 @@
1
- var ProstoMate=function(e){"use strict";function t(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function r(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");return e.Mate=class{constructor(e){this.workspace=e}set(e,r,a,o){var p;let s=Reflect.getMetadata(this.workspace,e.target,e.propKey)||{};const{index:n}=e,c="function"==typeof r?r:void 0;let i=s;if(i.params||(i.params=null===(p=Reflect.getMetadata("design:paramtypes",e.target,e.propKey))||void 0===p?void 0:p.map((e=>({type:e})))),"number"==typeof n&&(i.params=i.params||[],i.params[n]=i.params[n]||{type:void 0},c?i.params[n]=c(i.params[n]):i=i.params[n]),"function"!=typeof r)if(o){const e=i[r]||[];Array.isArray(e)||(t(f="Mate.add (isArray=true) called for non-array metadata"),new Error(f)),e.unshift(a),i[r]=e}else i[r]=a;else c&&"number"!=typeof n&&(s=c(i));var f;Reflect.defineMetadata(this.workspace,s,e.target,e.propKey)}read(e,t){return Reflect.getMetadata(this.workspace,"string"==typeof t?r(e)?e.prototype:e:r(e)?e:Object.getPrototypeOf(e).constructor,t)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,p)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof p?void 0:p,index:"number"==typeof p?p:void 0},e,t,r)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var ProstoMate=function(t){"use strict";function e(t){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+t+"")}function r(t){return o(t)?t:t.constructor?t.constructor:Object.getPrototypeOf(t).constructor}function o(t){return"function"==typeof t&&Object.getOwnPropertyNames(t).includes("prototype")&&!Object.getOwnPropertyNames(t).includes("caller")&&!!t.name}require("./reflect");const a=Object.getPrototypeOf(Function);return t.Mate=class{constructor(t,e={}){this.workspace=t,this.options=e}set(t,r,o,a){var n;let p=Reflect.getOwnMetadata(this.workspace,t.target,t.propKey)||{};t.propKey&&this.options.readReturnType&&!p.returnType&&(p.returnType=Reflect.getOwnMetadata("design:returntype",t.target,t.propKey)),t.propKey&&this.options.readType&&!p.type&&(p.type=Reflect.getOwnMetadata("design:type",t.target,t.propKey));const{index:s}=t,i="function"==typeof r?r:void 0;let c=p;if(c.params||(c.params=null===(n=Reflect.getOwnMetadata("design:paramtypes",t.target,t.propKey))||void 0===n?void 0:n.map((t=>({type:t})))),"number"==typeof s&&(c.params=c.params||[],c.params[s]=c.params[s]||{type:void 0},i?c.params[s]=i(c.params[s]):c=c.params[s]),"function"!=typeof r)if(a){const t=c[r]||[];Array.isArray(t)||(e(f="Mate.add (isArray=true) called for non-array metadata"),new Error(f)),t.unshift(o),c[r]=t}else c[r]=o;else i&&"number"!=typeof s&&(p=i(c));var f;Reflect.defineMetadata(this.workspace,p,t.target,t.propKey)}read(t,e){const n=o(t)?t:r(t);let p=Reflect.getOwnMetadata(this.workspace,"string"==typeof e?n.prototype:n,e);if(this.options.inherit){const t="function"==typeof this.options.inherit?this.options.inherit:void 0;let r=this.options.inherit;if(t)if("string"==typeof e){r=t(Reflect.getOwnMetadata(this.workspace,n),e,p)}else r=t(p);if(r){const t=Object.getPrototypeOf(n);if("function"==typeof t&&t!==a&&t!==n){p={...this.read(t,e),...p,params:null==p?void 0:p.params}}}}return p}apply(...t){return(e,r,o)=>{for(const a of t)a(e,r,o)}}decorate(t,e,r){return(o,a,n)=>{this.set({target:o,propKey:a,descriptor:"number"==typeof n?void 0:n,index:"number"==typeof n?n:void 0},t,e,r)}}},t.getConstructor=r,t.isConstructor=o,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
@@ -1,2 +1,3 @@
1
1
  export * from './mate';
2
+ export * from './utils/helpers';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA"}
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata';
2
1
  import { TAny, TFunction, TObject } from './types';
3
2
  export interface TMergedDecoratorArgs {
4
3
  target: TFunction | TObject;
@@ -8,17 +7,25 @@ export interface TMergedDecoratorArgs {
8
7
  }
9
8
  export interface TProstoMetadata<TParams extends TProstoParamsMetadata = TProstoParamsMetadata> {
10
9
  params: TParams[];
10
+ type?: TFunction;
11
+ returnType?: TFunction;
11
12
  }
12
13
  export interface TProstoParamsMetadata {
13
- type: TFunction;
14
+ type?: TFunction;
15
+ }
16
+ export interface TMateOptions<T extends TProstoMetadata = TProstoMetadata> {
17
+ readReturnType?: boolean;
18
+ readType?: boolean;
19
+ inherit?: boolean | ((classMeta: T, propKey?: string, methodMeta?: T) => boolean);
14
20
  }
15
21
  export declare class Mate<T extends TProstoMetadata = TProstoMetadata> {
16
22
  protected workspace: string;
17
- constructor(workspace: string);
23
+ protected options: TMateOptions<T>;
24
+ constructor(workspace: string, options?: TMateOptions<T>);
18
25
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, cb: ((meta: R & RP) => R & RP)): void;
19
26
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): void;
20
27
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined, isArray: boolean | undefined): void;
21
- read<R = T>(target: TFunction | TObject, propKey?: string | symbol): R | undefined;
28
+ read<R extends T = T>(target: TFunction | TObject, propKey?: string | symbol): R | undefined;
22
29
  apply(...decorators: (MethodDecorator & ClassDecorator & ParameterDecorator)[]): MethodDecorator & ClassDecorator & ParameterDecorator;
23
30
  decorate<R extends T = T, RP = R['params'][0]>(cb: ((meta: R & RP) => R & RP)): MethodDecorator & ClassDecorator & ParameterDecorator;
24
31
  decorate<R extends T = T, RP = R['params'][0]>(key: keyof R | keyof RP | ((meta: R & RP) => R & RP), value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): MethodDecorator & ClassDecorator & ParameterDecorator;
@@ -1 +1 @@
1
- {"version":3,"file":"mate.d.ts","sourceRoot":"","sources":["../../src/mate.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAK,SAAS,CAAA;AAGjD,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,qBAAqB,GAAG,qBAAqB;IAC1F,MAAM,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,SAAS,CAAA;CAClB;AAED,qBAAa,IAAI,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAC7C,SAAS,CAAC,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;IAEvC,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACpC,IAAI,EAAE,oBAAoB,EAC1B,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CA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G,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,EACrD,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAC5D,eAAe,GAAG,cAAc,GAAG,kBAAkB;IAExD,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACzC,GAAG,EAAG,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,EACrD,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EAC3D,OAAO,EAAE,OAAO,GAAG,SAAS,GAC7B,eAAe,GAAG,cAAc,GAAG,kBAAkB;CAiB3D"}
@@ -0,0 +1,7 @@
1
+ import { TFunction, TObject } from './types';
2
+ export declare const Reflect: {
3
+ getOwnMetadata(key: string | symbol, target: TObject | TFunction, prop?: string | symbol): unknown;
4
+ defineMetadata(key: string | symbol, data: unknown, target: TObject | TFunction, prop?: string | symbol): void;
5
+ metadata(key: string | symbol, data: unknown): ClassDecorator & MethodDecorator & ParameterDecorator;
6
+ };
7
+ //# sourceMappingURL=reflect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../../src/reflect.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAuD5C,eAAO,MAAM,OAAO;wBAnCI,MAAM,GAAG,MAAM,UAAU,OAAO,GAAG,SAAS,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO;wBAG9E,MAAM,GAAG,MAAM,QAAQ,OAAO,UAAU,OAAO,GAAG,SAAS,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI;kBAIhG,MAAM,GAAG,MAAM,QAAQ,OAAO,GAAG,cAAc,GAAG,eAAe,GAAG,kBAAkB;CA4BzE,CAAA"}
@@ -1,9 +1,25 @@
1
- export declare class DecoratorHelpersTestClass {
1
+ import { Mate, TProstoMetadata } from '..';
2
+ export declare const mate: Mate<{
3
+ inherit?: boolean | undefined;
4
+ } & TProstoMetadata<import("..").TProstoParamsMetadata>>;
5
+ export declare class MateTestClass {
2
6
  constructor(_a: string);
3
- test(_b: string): void;
7
+ test(_b: string): string;
4
8
  viaCB(_c: string): void;
5
9
  }
6
- export declare class DecoratorHelpersTestClass2 {
10
+ export declare class MateTestClass2 {
11
+ constructor(a: string);
7
12
  test(): void;
13
+ toOverwriteMeta(): void;
14
+ }
15
+ export declare class MateTestClass3 extends MateTestClass2 {
16
+ constructor();
17
+ test2(): void;
18
+ toOverwriteMeta(): void;
19
+ }
20
+ export declare class MateTestClass4 extends MateTestClass2 {
21
+ constructor();
22
+ test2(): void;
23
+ toOverwriteMeta(): void;
8
24
  }
9
25
  //# sourceMappingURL=mate.artifacts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mate.artifacts.d.ts","sourceRoot":"","sources":["../../../src/tests/mate.artifacts.ts"],"names":[],"mappings":"AASA,qBAGa,yBAAyB;gBAK1B,EAAE,EAAE,MAAM;IAQlB,IAAI,CAII,EAAE,EAAE,MAAM;IAgBlB,KAAK,CAMG,EAAE,EAAE,MAAM;CAGrB;AAED,qBACa,0BAA0B;IAInC,IAAI;CAGP"}
1
+ {"version":3,"file":"mate.artifacts.d.ts","sourceRoot":"","sources":["../../../src/tests/mate.artifacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAE1C,eAAO,MAAM,IAAI;;wDASf,CAAA;AAMF,qBAGa,aAAa;gBAKd,EAAE,EAAE,MAAM;IAQlB,IAAI,CAII,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB3B,KAAK,CAMG,EAAE,EAAE,MAAM;CAGrB;AAED,qBACa,cAAc;gBACX,CAAC,EAAE,MAAM;IAOrB,IAAI;IAMJ,eAAe;CAGlB;AAED,qBACa,cAAe,SAAQ,cAAc;;IAM9C,KAAK;IAML,eAAe;CAGlB;AAED,qBACa,cAAe,SAAQ,cAAc;;IAM9C,KAAK;IAKL,eAAe;CAGlB"}
@@ -0,0 +1,5 @@
1
+ export declare class ReflectTestClass {
2
+ constructor(a: boolean, b: Date);
3
+ method(a: string, b: number): void;
4
+ }
5
+ //# sourceMappingURL=reflect.artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflect.artifacts.d.ts","sourceRoot":"","sources":["../../../src/tests/reflect.artifacts.ts"],"names":[],"mappings":"AAIA,qBAEa,gBAAgB;gBAIrB,CAAC,EAAE,OAAO,EAGV,CAAC,EAAE,IAAI;IAKX,MAAM,CAGF,CAAC,EAAE,MAAM,EAGT,CAAC,EAAE,MAAM;CAEhB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reflect.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflect.spec.d.ts","sourceRoot":"","sources":["../../../src/tests/reflect.spec.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { TAny, TClassConstructor, TFunction, TObject } from '../types';
2
- export declare function getConstructor<T = TObject>(instance: T): TFunction;
3
- export declare function isConstructor<T = TAny>(v: T): v is T & TClassConstructor;
1
+ import { TAny, TClassConstructor, TFunction } from '../types';
2
+ export declare function getConstructor<T = TAny>(instance: T): TFunction;
3
+ export declare function isConstructor<T = TAny>(v: T): v is (T & TClassConstructor);
4
4
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtE,wBAAgB,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,CAGlE;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAExE"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAW,MAAM,UAAU,CAAA;AAEtE,wBAAgB,cAAc,CAAC,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,CAK/D;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAE1E"}
@@ -1,3 +1,4 @@
1
1
  export declare function log(text: string): void;
2
+ export declare function warn(text: string): void;
2
3
  export declare function logError(error: string): void;
3
4
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/utils/log.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,QAE/B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,QAErC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/utils/log.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,QAE/B;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,QAEhC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,QAErC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prostojs/mate",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "MATE is TS Metadata Organizer",
5
5
  "main": "index.js",
6
6
  "module": "dist/mate.esm-bundler.js",
@@ -39,9 +39,7 @@
39
39
  "global"
40
40
  ]
41
41
  },
42
- "dependencies": {
43
- "reflect-metadata": "^0.1.13"
44
- },
42
+ "dependencies": {},
45
43
  "gitHooks": {
46
44
  "commit-msg": "node scripts/verifyCommit.js"
47
45
  },
@@ -52,16 +50,17 @@
52
50
  },
53
51
  "homepage": "https://github.com/prostojs/mate#readme",
54
52
  "devDependencies": {
55
- "@microsoft/api-extractor": "^7.15.1",
56
- "@prostojs/dye": "^0.2.0",
53
+ "reflect-metadata": "^0.1.13",
54
+ "@microsoft/api-extractor": "^7.30.0",
55
+ "@prostojs/dye": "^0.3.0",
57
56
  "@rollup/plugin-commonjs": "^21.0.0",
58
57
  "@rollup/plugin-node-resolve": "^13.0.6",
59
58
  "@rollup/plugin-replace": "^3.0.0",
60
- "@types/jest": "^27.0.2",
61
- "@types/node": "^16.10.3",
59
+ "@types/jest": "^27.5.2",
60
+ "@types/node": "^16.11.57",
62
61
  "@typescript-eslint/eslint-plugin": "^4.33.0",
63
62
  "@typescript-eslint/parser": "^4.33.0",
64
- "brotli": "^1.3.2",
63
+ "brotli": "^1.3.3",
65
64
  "conventional-changelog": "^3.1.24",
66
65
  "conventional-changelog-cli": "^2.1.1",
67
66
  "enquirer": "^2.3.6",
@@ -71,15 +70,15 @@
71
70
  "execa": "^5.1.1",
72
71
  "fs-extra": "^10.0.0",
73
72
  "jest": "^27.2.5",
74
- "minimist": "^1.2.5",
73
+ "minimist": "^1.2.6",
75
74
  "rollup": "^2.58.0",
76
75
  "rollup-plugin-terser": "^7.0.2",
77
76
  "rollup-plugin-typescript2": "^0.30.0",
78
77
  "semver": "^7.3.5",
79
78
  "ts-jest": "^27.0.5",
80
- "ts-node": "^10.8.2",
79
+ "ts-node": "^10.9.1",
81
80
  "tslib": "^2.3.1",
82
- "typescript": "^4.4.3",
81
+ "typescript": "^4.8.2",
83
82
  "yorkie": "^2.0.0",
84
83
  "zlib": "^1.0.5"
85
84
  }