1 | "use strict";
|
2 | var index_1 = require("./index");
|
3 | var TypeMetadata_1 = require("./metadata/TypeMetadata");
|
4 | var ExposeMetadata_1 = require("./metadata/ExposeMetadata");
|
5 | var ExcludeMetadata_1 = require("./metadata/ExcludeMetadata");
|
6 | var TransformMetadata_1 = require("./metadata/TransformMetadata");
|
7 |
|
8 |
|
9 |
|
10 | function Transform(transformFn, options) {
|
11 | return function (target, key) {
|
12 | var metadata = new TransformMetadata_1.TransformMetadata(target.constructor, key, transformFn, options);
|
13 | index_1.defaultMetadataStorage.addTransformMetadata(metadata);
|
14 | };
|
15 | }
|
16 | exports.Transform = Transform;
|
17 |
|
18 |
|
19 |
|
20 | function Type(typeFunction) {
|
21 | return function (target, key) {
|
22 | var type = Reflect.getMetadata("design:type", target, key);
|
23 | var metadata = new TypeMetadata_1.TypeMetadata(target.constructor, key, type, typeFunction);
|
24 | index_1.defaultMetadataStorage.addTypeMetadata(metadata);
|
25 | };
|
26 | }
|
27 | exports.Type = Type;
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | function Expose(options) {
|
34 | return function (object, propertyName) {
|
35 | var metadata = new ExposeMetadata_1.ExposeMetadata(object instanceof Function ? object : object.constructor, propertyName, options || {});
|
36 | index_1.defaultMetadataStorage.addExposeMetadata(metadata);
|
37 | };
|
38 | }
|
39 | exports.Expose = Expose;
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | function Exclude(options) {
|
46 | return function (object, propertyName) {
|
47 | var metadata = new ExcludeMetadata_1.ExcludeMetadata(object instanceof Function ? object : object.constructor, propertyName, options || {});
|
48 | index_1.defaultMetadataStorage.addExcludeMetadata(metadata);
|
49 | };
|
50 | }
|
51 | exports.Exclude = Exclude;
|
52 |
|
53 |
|