class-transformer
Advanced tools
Comparing version 0.1.6 to 0.1.7
define("class-transformer/ClassTransformOptions", ["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
}); | ||
define("class-transformer/metadata/ExposeExcludeOptions", ["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
}); | ||
define("class-transformer/metadata/TypeMetadata", ["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TypeMetadata = (function () { | ||
@@ -22,2 +25,3 @@ function TypeMetadata(target, propertyName, reflectedType, typeFunction) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExposeMetadata = (function () { | ||
@@ -35,2 +39,3 @@ function ExposeMetadata(target, propertyName, options) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExcludeMetadata = (function () { | ||
@@ -48,2 +53,3 @@ function ExcludeMetadata(target, propertyName, options) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformMetadata = (function () { | ||
@@ -62,2 +68,3 @@ function TransformMetadata(target, propertyName, transformFn, options) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -117,4 +124,4 @@ * Storage all library metadata. | ||
MetadataStorage.prototype.findExposeMetadataByCustomName = function (target, name) { | ||
return this._exposeMetadatas.find(function (metadata) { | ||
return metadata.target === target && metadata.options && metadata.options.name === name; | ||
return this.getExposedMetadatas(target).find(function (metadata) { | ||
return metadata.options && metadata.options.name === name; | ||
}); | ||
@@ -201,2 +208,3 @@ }; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -209,2 +217,3 @@ * Default metadata storage is used as singleton and can be used to storage all metadatas. | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformOperationExecutor = (function () { | ||
@@ -220,3 +229,3 @@ // ------------------------------------------------------------------------- | ||
// ------------------------------------------------------------------------- | ||
this.transformedTypes = []; | ||
this.transformedTypesMap = new Map(); | ||
} | ||
@@ -233,3 +242,3 @@ // ------------------------------------------------------------------------- | ||
var subSource = source ? source[index] : undefined; | ||
if (!_this.isCircular(subValue, level)) { | ||
if (!_this.options.enableCircularCheck || !_this.isCircular(subValue, level)) { | ||
var value_1 = _this.transform(subSource, subValue, targetType, undefined, subValue instanceof Map, level + 1); | ||
@@ -277,4 +286,6 @@ if (newValue_1 instanceof Set) { | ||
targetType = source.constructor; | ||
// add transformed type to prevent circular references | ||
this.transformedTypes.push({ level: level, object: value }); | ||
if (this.options.enableCircularCheck) { | ||
// add transformed type to prevent circular references | ||
this.transformedTypesMap.set(value, { level: level, object: value }); | ||
} | ||
var keys = this.getKeys(targetType, value); | ||
@@ -293,4 +304,3 @@ var newValue = source ? source : {}; | ||
} | ||
// traverse over keys | ||
var _loop_1 = function(key) { | ||
var _loop_1 = function (key) { | ||
var valueKey = key, newValueKey = key, propertyName = key; | ||
@@ -355,3 +365,3 @@ if (!this_1.options.ignoreDecorators && targetType) { | ||
} | ||
if (!this_1.isCircular(subValue, level)) { | ||
if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue, level)) { | ||
var transformKey = this_1.transformationType === "plainToClass" ? newValueKey : key; | ||
@@ -379,2 +389,3 @@ var finalValue = this_1.transform(subSource, subValue, type, arrayType_1, isSubValueMap, level + 1); | ||
var this_1 = this; | ||
// traverse over keys | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
@@ -423,3 +434,4 @@ var key = keys_1[_i]; | ||
TransformOperationExecutor.prototype.isCircular = function (object, level) { | ||
return !!this.transformedTypes.find(function (transformed) { return transformed.object === object && transformed.level < level; }); | ||
var transformed = this.transformedTypesMap.get(object); | ||
return transformed !== undefined && transformed.level < level; | ||
}; | ||
@@ -527,2 +539,3 @@ TransformOperationExecutor.prototype.getReflectedType = function (target, propertyName) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ClassTransformer = (function () { | ||
@@ -578,2 +591,3 @@ function ClassTransformer() { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -634,3 +648,3 @@ * Defines a custom logic for value transformation. | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -654,3 +668,3 @@ var result = originalMethod.apply(this, args); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -670,2 +684,3 @@ var result = originalMethod.apply(this, args); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ClassTransformer = ClassTransformer_3.ClassTransformer; | ||
@@ -722,3 +737,4 @@ __export(decorators_1); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(index_1); | ||
}); |
@@ -1,1 +0,1 @@ | ||
define("class-transformer/ClassTransformOptions",["require","exports"],function(t,e){"use strict"}),define("class-transformer/metadata/ExposeExcludeOptions",["require","exports"],function(t,e){"use strict"}),define("class-transformer/metadata/TypeMetadata",["require","exports"],function(t,e){"use strict";var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}();e.TypeMetadata=a}),define("class-transformer/metadata/ExposeMetadata",["require","exports"],function(t,e){"use strict";var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExposeMetadata=a}),define("class-transformer/metadata/ExcludeMetadata",["require","exports"],function(t,e){"use strict";var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExcludeMetadata=a}),define("class-transformer/metadata/TransformMetadata",["require","exports"],function(t,e){"use strict";var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}();e.TransformMetadata=a}),define("class-transformer/metadata/MetadataStorage",["require","exports"],function(t,e){"use strict";var a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===a||"plainToClass"===a:t.options.toPlainOnly!==!0||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this._exposeMetadatas.find(function(a){return a.target===t&&a.options&&a.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName}),r=t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName});return r.concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),o=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||o},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a}),o=t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return o.reverse().concat(r.reverse())},t}();e.MetadataStorage=a}),define("class-transformer/storage",["require","exports","class-transformer/metadata/MetadataStorage"],function(t,e,a){"use strict";e.defaultMetadataStorage=new a.MetadataStorage}),define("class-transformer/TransformOperationExecutor",["require","exports","class-transformer/storage"],function(t,e,a){"use strict";var r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypes=[]}return t.prototype.transform=function(t,e,r,o,n,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var f=o&&"plainToClass"===this.transformationType?new o:[];return e.forEach(function(e,a){var o=t?t[a]:void 0;if(i.isCircular(e,s))"classToClass"===i.transformationType&&(f instanceof Set?f.add(e):f.push(e));else{var n=i.transform(o,e,r,void 0,e instanceof Map,s+1);f instanceof Set?f.add(n):f.push(n)}}),f}if(r!==String||n){if(r!==Number||n){if(r!==Boolean||n){if((r===Date||e instanceof Date)&&!n)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.transformedTypes.push({level:s,object:e});var p=this.getKeys(r,e),u=t?t:{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(u=n?new Map:r?new r:{});for(var c=function(o){var i=o,f=o,p=o;if(!l.options.ignoreDecorators&&r)if("plainToClass"===l.transformationType){var c=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,o);c&&(p=c.propertyName,f=c.propertyName)}else if("classToPlain"===l.transformationType||"classToClass"===l.transformationType){var c=a.defaultMetadataStorage.findExposeMetadata(r,o);c&&c.options&&c.options.name&&(f=c.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var m=void 0,y=d instanceof Map;if(r&&n)m=r;else if(r){var T=a.defaultMetadataStorage.findTypeMetadata(r,p);if(T){var v={newObject:u,object:e,property:p};m=T.typeFunction(v),y=y||T.reflectedType===Map}else l.options.targetMaps&&l.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[p]}).forEach(function(t){return m=t.properties[p]})}var h=e[i]instanceof Array?l.getReflectedType(r,p):void 0,M=t?t[i]:void 0;if(u.constructor.prototype){var x=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(("plainToClass"===l.transformationType||"classToClass"===l.transformationType)&&(u[f]instanceof Function||x&&!x.set))return"continue"}if(l.isCircular(d,s)){if("classToClass"===l.transformationType){var g=d;g=l.applyCustomTransformations(g,r,o),u instanceof Map?u.set(f,g):u[f]=g}}else{var C="plainToClass"===l.transformationType?f:o,g=l.transform(M,d,m,h,y,s+1);g=l.applyCustomTransformations(g,r,C),u instanceof Map?u.set(f,g):u[f]=g}},l=this,d=0,m=p;d<m.length;d++){var y=m[d];c(y)}return u}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var o=this,n=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(n=n.filter(function(t){return!t.options||o.checkVersion(t.options.since,t.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(t){return!t.options||o.checkGroups(t.options.groups)}):n.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),n.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){return!!this.transformedTypes.find(function(a){return a.object===t&&a.level<e})},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,o=a.defaultMetadataStorage.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");var n=[];if("exposeAll"===o&&(n=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),n=n.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(n=n.filter(function(t){return i.indexOf(t)===-1})),void 0!==this.options.version&&(n=n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkVersion(o.options.since,o.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkGroups(o.options.groups)}):n.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(n=n.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),n=n.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return t.indexOf(e)!==-1})},t}();e.TransformOperationExecutor=r}),define("class-transformer/ClassTransformer",["require","exports","class-transformer/TransformOperationExecutor"],function(t,e,a){"use strict";var r=function(){function t(){}return t.prototype.classToPlain=function(t,e){var r=new a.TransformOperationExecutor("classToPlain",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){var o=new a.TransformOperationExecutor("classToPlain",r||{});return o.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){var o=new a.TransformOperationExecutor("plainToClass",r||{});return o.transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){var o=new a.TransformOperationExecutor("plainToClass",r||{});return o.transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){var r=new a.TransformOperationExecutor("classToClass",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){var o=new a.TransformOperationExecutor("classToClass",r||{});return o.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}();e.ClassTransformer=r}),define("class-transformer/decorators",["require","exports","class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e,a,r,o,n,s,i){"use strict";function f(t,e){return function(a,o){var n=new i.TransformMetadata(a.constructor,o,t,e);r.defaultMetadataStorage.addTransformMetadata(n)}}function p(t){return function(e,a){var n=Reflect.getMetadata("design:type",e,a),s=new o.TypeMetadata(e.constructor,a,n,t);r.defaultMetadataStorage.addTypeMetadata(s)}}function u(t){return function(e,a){var o=new n.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExposeMetadata(o)}}function c(t){return function(e,a){var o=new s.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExcludeMetadata(o)}}function l(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=s.apply(this,e),o=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return o?r.then(function(e){return n.classToPlain(e,t)}):n.classToPlain(r,t)}}}function d(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=s.apply(this,e),o=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return o?r.then(function(e){return n.classToClass(e,t)}):n.classToClass(r,t)}}}e.Transform=f,e.Type=p,e.Expose=u,e.Exclude=c,e.TransformClassToPlain=l,e.TransformClassToClass=d}),define("class-transformer/index",["require","exports","class-transformer/ClassTransformer","class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e,a,r,o){"use strict";function n(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}function s(t,e){return y.classToPlain(t,e)}function i(t,e,a){return y.classToPlainFromExist(t,e,a)}function f(t,e,a){return y.plainToClass(t,e,a)}function p(t,e,a){return y.plainToClassFromExist(t,e,a)}function u(t,e){return y.classToClass(t,e)}function c(t,e,a){return y.classToClassFromExist(t,e,a)}function l(t,e){return y.serialize(t,e)}function d(t,e,a){return y.deserialize(t,e,a)}function m(t,e,a){return y.deserializeArray(t,e,a)}e.ClassTransformer=r.ClassTransformer,n(o);var y=new a.ClassTransformer;e.classToPlain=s,e.classToPlainFromExist=i,e.plainToClass=f,e.plainToClassFromExist=p,e.classToClass=u,e.classToClassFromExist=c,e.serialize=l,e.deserialize=d,e.deserializeArray=m}),define("class-transformer",["require","exports","class-transformer/index"],function(t,e,a){"use strict";function r(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}r(a)}); | ||
define("class-transformer/ClassTransformOptions",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}),define("class-transformer/metadata/ExposeExcludeOptions",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})}),define("class-transformer/metadata/TypeMetadata",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}();e.TypeMetadata=a}),define("class-transformer/metadata/ExposeMetadata",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExposeMetadata=a}),define("class-transformer/metadata/ExcludeMetadata",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExcludeMetadata=a}),define("class-transformer/metadata/TransformMetadata",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}();e.TransformMetadata=a}),define("class-transformer/metadata/MetadataStorage",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===a||"plainToClass"===a:!0!==t.options.toPlainOnly||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find(function(t){return t.options&&t.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName});return t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName}).concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),o=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||o},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a});return t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a}).reverse().concat(r.reverse())},t}();e.MetadataStorage=a}),define("class-transformer/storage",["require","exports","class-transformer/metadata/MetadataStorage"],function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultMetadataStorage=new a.MetadataStorage}),define("class-transformer/TransformOperationExecutor",["require","exports","class-transformer/storage"],function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypesMap=new Map}return t.prototype.transform=function(t,e,r,o,n,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var u=o&&"plainToClass"===this.transformationType?new o:[];return e.forEach(function(e,a){var o=t?t[a]:void 0;if(i.options.enableCircularCheck&&i.isCircular(e,s))"classToClass"===i.transformationType&&(u instanceof Set?u.add(e):u.push(e));else{var n=i.transform(o,e,r,void 0,e instanceof Map,s+1);u instanceof Set?u.add(n):u.push(n)}}),u}if(r!==String||n){if(r!==Number||n){if(r!==Boolean||n){if((r===Date||e instanceof Date)&&!n)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.options.enableCircularCheck&&this.transformedTypesMap.set(e,{level:s,object:e});var f=this.getKeys(r,e),p=t||{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(p=n?new Map:r?new r:{});for(var c=this,l=0,d=f;l<d.length;l++){var y=d[l];!function(o){var i=o,u=o,f=o;if(!c.options.ignoreDecorators&&r)if("plainToClass"===c.transformationType){var l=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,o);l&&(f=l.propertyName,u=l.propertyName)}else if("classToPlain"===c.transformationType||"classToClass"===c.transformationType){var l=a.defaultMetadataStorage.findExposeMetadata(r,o);l&&l.options&&l.options.name&&(u=l.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var y=void 0,m=d instanceof Map;if(r&&n)y=r;else if(r){var v=a.defaultMetadataStorage.findTypeMetadata(r,f);if(v){var T={newObject:p,object:e,property:f};y=v.typeFunction(T),m=m||v.reflectedType===Map}else c.options.targetMaps&&c.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[f]}).forEach(function(t){return y=t.properties[f]})}var M=e[i]instanceof Array?c.getReflectedType(r,f):void 0,h=t?t[i]:void 0;if(p.constructor.prototype){var x=Object.getOwnPropertyDescriptor(p.constructor.prototype,u);if(("plainToClass"===c.transformationType||"classToClass"===c.transformationType)&&(p[u]instanceof Function||x&&!x.set))return"continue"}if(c.options.enableCircularCheck&&c.isCircular(d,s)){if("classToClass"===c.transformationType){var g=d;g=c.applyCustomTransformations(g,r,o),p instanceof Map?p.set(u,g):p[u]=g}}else{var C="plainToClass"===c.transformationType?u:o,g=c.transform(h,d,y,M,m,s+1);g=c.applyCustomTransformations(g,r,C),p instanceof Map?p.set(u,g):p[u]=g}}(y)}return p}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var o=this,n=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(n=n.filter(function(t){return!t.options||o.checkVersion(t.options.since,t.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(t){return!t.options||o.checkGroups(t.options.groups)}):n.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),n.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){var a=this.transformedTypesMap.get(t);return void 0!==a&&a.level<e},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,o=a.defaultMetadataStorage.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");var n=[];if("exposeAll"===o&&(n=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),n=n.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(n=n.filter(function(t){return-1===i.indexOf(t)})),void 0!==this.options.version&&(n=n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkVersion(o.options.since,o.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkGroups(o.options.groups)}):n.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(n=n.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),n=n.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return-1!==t.indexOf(e)})},t}();e.TransformOperationExecutor=r}),define("class-transformer/ClassTransformer",["require","exports","class-transformer/TransformOperationExecutor"],function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.classToPlain=function(t,e){return new a.TransformOperationExecutor("classToPlain",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToPlain",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){return new a.TransformOperationExecutor("classToClass",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToClass",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}();e.ClassTransformer=r}),define("class-transformer/decorators",["require","exports","class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e,a,r,o,n,s,i){"use strict";function u(t,e){return function(a,o){var n=new i.TransformMetadata(a.constructor,o,t,e);r.defaultMetadataStorage.addTransformMetadata(n)}}function f(t){return function(e,a){var n=Reflect.getMetadata("design:type",e,a),s=new o.TypeMetadata(e.constructor,a,n,t);r.defaultMetadataStorage.addTypeMetadata(s)}}function p(t){return function(e,a){var o=new n.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExposeMetadata(o)}}function c(t){return function(e,a){var o=new s.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExcludeMetadata(o)}}function l(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=s.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToPlain(r,t):r.then(function(e){return n.classToPlain(e,t)})}}}function d(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=s.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToClass(r,t):r.then(function(e){return n.classToClass(e,t)})}}}Object.defineProperty(e,"__esModule",{value:!0}),e.Transform=u,e.Type=f,e.Expose=p,e.Exclude=c,e.TransformClassToPlain=l,e.TransformClassToClass=d}),define("class-transformer/index",["require","exports","class-transformer/ClassTransformer","class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e,a,r,o){"use strict";function n(t,e){return y.classToPlain(t,e)}function s(t,e,a){return y.classToPlainFromExist(t,e,a)}function i(t,e,a){return y.plainToClass(t,e,a)}function u(t,e,a){return y.plainToClassFromExist(t,e,a)}function f(t,e){return y.classToClass(t,e)}function p(t,e,a){return y.classToClassFromExist(t,e,a)}function c(t,e){return y.serialize(t,e)}function l(t,e,a){return y.deserialize(t,e,a)}function d(t,e,a){return y.deserializeArray(t,e,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.ClassTransformer=r.ClassTransformer,function(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}(o);var y=new a.ClassTransformer;e.classToPlain=n,e.classToPlainFromExist=s,e.plainToClass=i,e.plainToClassFromExist=u,e.classToClass=f,e.classToClassFromExist=p,e.serialize=c,e.deserialize=l,e.deserializeArray=d}),define("class-transformer",["require","exports","class-transformer/index"],function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}(a)}); |
define("class-transformer/ClassTransformOptions", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
}); | ||
define("class-transformer/metadata/ExposeExcludeOptions", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
}); | ||
define("class-transformer/metadata/TypeMetadata", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TypeMetadata = (function () { | ||
@@ -18,2 +21,3 @@ function TypeMetadata(target, propertyName, reflectedType, typeFunction) { | ||
define("class-transformer/metadata/ExposeMetadata", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExposeMetadata = (function () { | ||
@@ -30,2 +34,3 @@ function ExposeMetadata(target, propertyName, options) { | ||
define("class-transformer/metadata/ExcludeMetadata", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExcludeMetadata = (function () { | ||
@@ -42,2 +47,3 @@ function ExcludeMetadata(target, propertyName, options) { | ||
define("class-transformer/metadata/TransformMetadata", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformMetadata = (function () { | ||
@@ -55,2 +61,3 @@ function TransformMetadata(target, propertyName, transformFn, options) { | ||
define("class-transformer/metadata/MetadataStorage", ["require", "exports"], function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -110,4 +117,4 @@ * Storage all library metadata. | ||
MetadataStorage.prototype.findExposeMetadataByCustomName = function (target, name) { | ||
return this._exposeMetadatas.find(function (metadata) { | ||
return metadata.target === target && metadata.options && metadata.options.name === name; | ||
return this.getExposedMetadatas(target).find(function (metadata) { | ||
return metadata.options && metadata.options.name === name; | ||
}); | ||
@@ -193,2 +200,3 @@ }; | ||
define("class-transformer/storage", ["require", "exports", "class-transformer/metadata/MetadataStorage"], function (require, exports, MetadataStorage_1) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -200,2 +208,3 @@ * Default metadata storage is used as singleton and can be used to storage all metadatas. | ||
define("class-transformer/TransformOperationExecutor", ["require", "exports", "class-transformer/storage"], function (require, exports, storage_1) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformOperationExecutor = (function () { | ||
@@ -211,3 +220,3 @@ // ------------------------------------------------------------------------- | ||
// ------------------------------------------------------------------------- | ||
this.transformedTypes = []; | ||
this.transformedTypesMap = new Map(); | ||
} | ||
@@ -224,3 +233,3 @@ // ------------------------------------------------------------------------- | ||
var subSource = source ? source[index] : undefined; | ||
if (!_this.isCircular(subValue, level)) { | ||
if (!_this.options.enableCircularCheck || !_this.isCircular(subValue, level)) { | ||
var value_1 = _this.transform(subSource, subValue, targetType, undefined, subValue instanceof Map, level + 1); | ||
@@ -268,4 +277,6 @@ if (newValue_1 instanceof Set) { | ||
targetType = source.constructor; | ||
// add transformed type to prevent circular references | ||
this.transformedTypes.push({ level: level, object: value }); | ||
if (this.options.enableCircularCheck) { | ||
// add transformed type to prevent circular references | ||
this.transformedTypesMap.set(value, { level: level, object: value }); | ||
} | ||
var keys = this.getKeys(targetType, value); | ||
@@ -284,4 +295,3 @@ var newValue = source ? source : {}; | ||
} | ||
// traverse over keys | ||
var _loop_1 = function(key) { | ||
var _loop_1 = function (key) { | ||
var valueKey = key, newValueKey = key, propertyName = key; | ||
@@ -346,3 +356,3 @@ if (!this_1.options.ignoreDecorators && targetType) { | ||
} | ||
if (!this_1.isCircular(subValue, level)) { | ||
if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue, level)) { | ||
var transformKey = this_1.transformationType === "plainToClass" ? newValueKey : key; | ||
@@ -370,2 +380,3 @@ var finalValue = this_1.transform(subSource, subValue, type, arrayType_1, isSubValueMap, level + 1); | ||
var this_1 = this; | ||
// traverse over keys | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
@@ -414,3 +425,4 @@ var key = keys_1[_i]; | ||
TransformOperationExecutor.prototype.isCircular = function (object, level) { | ||
return !!this.transformedTypes.find(function (transformed) { return transformed.object === object && transformed.level < level; }); | ||
var transformed = this.transformedTypesMap.get(object); | ||
return transformed !== undefined && transformed.level < level; | ||
}; | ||
@@ -517,2 +529,3 @@ TransformOperationExecutor.prototype.getReflectedType = function (target, propertyName) { | ||
define("class-transformer/ClassTransformer", ["require", "exports", "class-transformer/TransformOperationExecutor"], function (require, exports, TransformOperationExecutor_1) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ClassTransformer = (function () { | ||
@@ -567,2 +580,3 @@ function ClassTransformer() { | ||
define("class-transformer/decorators", ["require", "exports", "class-transformer/ClassTransformer", "class-transformer/storage", "class-transformer/metadata/TypeMetadata", "class-transformer/metadata/ExposeMetadata", "class-transformer/metadata/ExcludeMetadata", "class-transformer/metadata/TransformMetadata"], function (require, exports, ClassTransformer_1, storage_2, TypeMetadata_1, ExposeMetadata_1, ExcludeMetadata_1, TransformMetadata_1) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -623,3 +637,3 @@ * Defines a custom logic for value transformation. | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -643,3 +657,3 @@ var result = originalMethod.apply(this, args); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -658,2 +672,3 @@ var result = originalMethod.apply(this, args); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ClassTransformer = ClassTransformer_3.ClassTransformer; | ||
@@ -709,3 +724,4 @@ __export(decorators_1); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(index_1); | ||
}); |
@@ -1,1 +0,1 @@ | ||
define("class-transformer/ClassTransformOptions",["require","exports"],function(t,a){}),define("class-transformer/metadata/ExposeExcludeOptions",["require","exports"],function(t,a){}),define("class-transformer/metadata/TypeMetadata",["require","exports"],function(t,a){var e=function(){function t(t,a,e,r){this.target=t,this.propertyName=a,this.reflectedType=e,this.typeFunction=r}return t}();a.TypeMetadata=e}),define("class-transformer/metadata/ExposeMetadata",["require","exports"],function(t,a){var e=function(){function t(t,a,e){this.target=t,this.propertyName=a,this.options=e}return t}();a.ExposeMetadata=e}),define("class-transformer/metadata/ExcludeMetadata",["require","exports"],function(t,a){var e=function(){function t(t,a,e){this.target=t,this.propertyName=a,this.options=e}return t}();a.ExcludeMetadata=e}),define("class-transformer/metadata/TransformMetadata",["require","exports"],function(t,a){var e=function(){function t(t,a,e,r){this.target=t,this.propertyName=a,this.transformFn=e,this.options=r}return t}();a.TransformMetadata=e}),define("class-transformer/metadata/MetadataStorage",["require","exports"],function(t,a){var e=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,a,e){return this.findMetadatas(this._transformMetadatas,t,a).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))})},t.prototype.findExcludeMetadata=function(t,a){return this.findMetadata(this._excludeMetadatas,t,a)},t.prototype.findExposeMetadata=function(t,a){return this.findMetadata(this._exposeMetadatas,t,a)},t.prototype.findExposeMetadataByCustomName=function(t,a){return this._exposeMetadatas.find(function(e){return e.target===t&&e.options&&e.options.name===a})},t.prototype.findTypeMetadata=function(t,a){return this.findMetadata(this._typeMetadatas,t,a)},t.prototype.getStrategy=function(t){var a=this._excludeMetadatas.find(function(a){return a.target===t&&void 0===a.propertyName}),e=this._exposeMetadatas.find(function(a){return a.target===t&&void 0===a.propertyName});return a&&e||!a&&!e?"none":a?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,a){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===a||"plainToClass"===a:t.options.toPlainOnly!==!0||"classToPlain"===a))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,a){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===a||"plainToClass"===a:t.options.toPlainOnly!==!0||"classToPlain"===a))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,a){var e=t.filter(function(t){return t.target===a&&void 0!==t.propertyName}),r=t.filter(function(t){return a.prototype instanceof t.target&&void 0!==t.propertyName});return r.concat(e)},t.prototype.findMetadata=function(t,a,e){var r=t.find(function(t){return t.target===a&&t.propertyName===e}),o=t.find(function(t){return a.prototype instanceof t.target&&t.propertyName===e});return r||o},t.prototype.findMetadatas=function(t,a,e){var r=t.filter(function(t){return t.target===a&&t.propertyName===e}),o=t.filter(function(t){return a.prototype instanceof t.target&&t.propertyName===e});return o.reverse().concat(r.reverse())},t}();a.MetadataStorage=e}),define("class-transformer/storage",["require","exports","class-transformer/metadata/MetadataStorage"],function(t,a,e){a.defaultMetadataStorage=new e.MetadataStorage}),define("class-transformer/TransformOperationExecutor",["require","exports","class-transformer/storage"],function(t,a,e){var r=function(){function t(t,a){this.transformationType=t,this.options=a,this.transformedTypes=[]}return t.prototype.transform=function(t,a,r,o,n,s){var i=this;if(void 0===s&&(s=0),a instanceof Array||a instanceof Set){var f=o&&"plainToClass"===this.transformationType?new o:[];return a.forEach(function(a,e){var o=t?t[e]:void 0;if(i.isCircular(a,s))"classToClass"===i.transformationType&&(f instanceof Set?f.add(a):f.push(a));else{var n=i.transform(o,a,r,void 0,a instanceof Map,s+1);f instanceof Set?f.add(n):f.push(n)}}),f}if(r!==String||n){if(r!==Number||n){if(r!==Boolean||n){if((r===Date||a instanceof Date)&&!n)return a instanceof Date?new Date(a.valueOf()):null===a||void 0===a?a:new Date(a);if(a instanceof Object){r||a.constructor===Object||(r=a.constructor),!r&&t&&(r=t.constructor),this.transformedTypes.push({level:s,object:a});var p=this.getKeys(r,a),u=t?t:{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(u=n?new Map:r?new r:{});for(var c=function(o){var i=o,f=o,p=o;if(!l.options.ignoreDecorators&&r)if("plainToClass"===l.transformationType){var c=e.defaultMetadataStorage.findExposeMetadataByCustomName(r,o);c&&(p=c.propertyName,f=c.propertyName)}else if("classToPlain"===l.transformationType||"classToClass"===l.transformationType){var c=e.defaultMetadataStorage.findExposeMetadata(r,o);c&&c.options&&c.options.name&&(f=c.options.name)}var d=void 0;d=a instanceof Map?a.get(i):a[i]instanceof Function?a[i]():a[i];var m=void 0,y=d instanceof Map;if(r&&n)m=r;else if(r){var T=e.defaultMetadataStorage.findTypeMetadata(r,p);if(T){var v={newObject:u,object:a,property:p};m=T.typeFunction(v),y=y||T.reflectedType===Map}else l.options.targetMaps&&l.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[p]}).forEach(function(t){return m=t.properties[p]})}var h=a[i]instanceof Array?l.getReflectedType(r,p):void 0,M=t?t[i]:void 0;if(u.constructor.prototype){var x=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(("plainToClass"===l.transformationType||"classToClass"===l.transformationType)&&(u[f]instanceof Function||x&&!x.set))return"continue"}if(l.isCircular(d,s)){if("classToClass"===l.transformationType){var g=d;g=l.applyCustomTransformations(g,r,o),u instanceof Map?u.set(f,g):u[f]=g}}else{var C="plainToClass"===l.transformationType?f:o,g=l.transform(M,d,m,h,y,s+1);g=l.applyCustomTransformations(g,r,C),u instanceof Map?u.set(f,g):u[f]=g}},l=this,d=0,m=p;d<m.length;d++){var y=m[d];c(y)}return u}return a}return Boolean(a)}return Number(a)}return String(a)},t.prototype.applyCustomTransformations=function(t,a,r){var o=this,n=e.defaultMetadataStorage.findTransformMetadatas(a,r,this.transformationType);return void 0!==this.options.version&&(n=n.filter(function(t){return!t.options||o.checkVersion(t.options.since,t.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(t){return!t.options||o.checkGroups(t.options.groups)}):n.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),n.forEach(function(a){t=a.transformFn(t)}),t},t.prototype.isCircular=function(t,a){return!!this.transformedTypes.find(function(e){return e.object===t&&e.level<a})},t.prototype.getReflectedType=function(t,a){if(t){var r=e.defaultMetadataStorage.findTypeMetadata(t,a);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,a){var r=this,o=e.defaultMetadataStorage.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");var n=[];if("exposeAll"===o&&(n=a instanceof Map?Array.from(a.keys()):Object.keys(a)),!this.options.ignoreDecorators&&t){var s=e.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(a){var r=e.defaultMetadataStorage.findExposeMetadata(t,a);return r&&r.options&&r.options.name?r.options.name:a})),n=n.concat(s);var i=e.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(n=n.filter(function(t){return i.indexOf(t)===-1})),void 0!==this.options.version&&(n=n.filter(function(a){var o=e.defaultMetadataStorage.findExposeMetadata(t,a);return!o||!o.options||r.checkVersion(o.options.since,o.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(a){var o=e.defaultMetadataStorage.findExposeMetadata(t,a);return!o||!o.options||r.checkGroups(o.options.groups)}):n.filter(function(a){var r=e.defaultMetadataStorage.findExposeMetadata(t,a);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(n=n.filter(function(t){return r.options.excludePrefixes.every(function(a){return t.substr(0,a.length)!==a})})),n=n.filter(function(t,a,e){return e.indexOf(t)===a})},t.prototype.checkVersion=function(t,a){var e=!0;return e&&t&&(e=this.options.version>=t),e&&a&&(e=this.options.version<a),e},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(a){return t.indexOf(a)!==-1})},t}();a.TransformOperationExecutor=r}),define("class-transformer/ClassTransformer",["require","exports","class-transformer/TransformOperationExecutor"],function(t,a,e){var r=function(){function t(){}return t.prototype.classToPlain=function(t,a){var r=new e.TransformOperationExecutor("classToPlain",a||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,a,r){var o=new e.TransformOperationExecutor("classToPlain",r||{});return o.transform(a,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,a,r){var o=new e.TransformOperationExecutor("plainToClass",r||{});return o.transform(void 0,a,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,a,r){var o=new e.TransformOperationExecutor("plainToClass",r||{});return o.transform(t,a,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,a){var r=new e.TransformOperationExecutor("classToClass",a||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,a,r){var o=new e.TransformOperationExecutor("classToClass",r||{});return o.transform(a,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,a){return JSON.stringify(this.classToPlain(t,a))},t.prototype.deserialize=function(t,a,e){var r=JSON.parse(a);return this.plainToClass(t,r,e)},t.prototype.deserializeArray=function(t,a,e){var r=JSON.parse(a);return this.plainToClass(t,r,e)},t}();a.ClassTransformer=r}),define("class-transformer/decorators",["require","exports","class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,a,e,r,o,n,s,i){function f(t,a){return function(e,o){var n=new i.TransformMetadata(e.constructor,o,t,a);r.defaultMetadataStorage.addTransformMetadata(n)}}function p(t){return function(a,e){var n=Reflect.getMetadata("design:type",a,e),s=new o.TypeMetadata(a.constructor,e,n,t);r.defaultMetadataStorage.addTypeMetadata(s)}}function u(t){return function(a,e){var o=new n.ExposeMetadata(a instanceof Function?a:a.constructor,e,t||{});r.defaultMetadataStorage.addExposeMetadata(o)}}function c(t){return function(a,e){var o=new s.ExcludeMetadata(a instanceof Function?a:a.constructor,e,t||{});r.defaultMetadataStorage.addExcludeMetadata(o)}}function l(t){return function(a,r,o){var n=new e.ClassTransformer,s=o.value;o.value=function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];var r=s.apply(this,a),o=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return o?r.then(function(a){return n.classToPlain(a,t)}):n.classToPlain(r,t)}}}function d(t){return function(a,r,o){var n=new e.ClassTransformer,s=o.value;o.value=function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];var r=s.apply(this,a),o=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return o?r.then(function(a){return n.classToClass(a,t)}):n.classToClass(r,t)}}}a.Transform=f,a.Type=p,a.Expose=u,a.Exclude=c,a.TransformClassToPlain=l,a.TransformClassToClass=d}),define("class-transformer/index",["require","exports","class-transformer/ClassTransformer","class-transformer/ClassTransformer","class-transformer/decorators"],function(t,a,e,r,o){function n(t){for(var e in t)a.hasOwnProperty(e)||(a[e]=t[e])}function s(t,a){return y.classToPlain(t,a)}function i(t,a,e){return y.classToPlainFromExist(t,a,e)}function f(t,a,e){return y.plainToClass(t,a,e)}function p(t,a,e){return y.plainToClassFromExist(t,a,e)}function u(t,a){return y.classToClass(t,a)}function c(t,a,e){return y.classToClassFromExist(t,a,e)}function l(t,a){return y.serialize(t,a)}function d(t,a,e){return y.deserialize(t,a,e)}function m(t,a,e){return y.deserializeArray(t,a,e)}a.ClassTransformer=r.ClassTransformer,n(o);var y=new e.ClassTransformer;a.classToPlain=s,a.classToPlainFromExist=i,a.plainToClass=f,a.plainToClassFromExist=p,a.classToClass=u,a.classToClassFromExist=c,a.serialize=l,a.deserialize=d,a.deserializeArray=m}),define("class-transformer",["require","exports","class-transformer/index"],function(t,a,e){function r(t){for(var e in t)a.hasOwnProperty(e)||(a[e]=t[e])}r(e)}); | ||
define("class-transformer/ClassTransformOptions",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0})}),define("class-transformer/metadata/ExposeExcludeOptions",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0})}),define("class-transformer/metadata/TypeMetadata",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}();e.TypeMetadata=a}),define("class-transformer/metadata/ExposeMetadata",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExposeMetadata=a}),define("class-transformer/metadata/ExcludeMetadata",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}();e.ExcludeMetadata=a}),define("class-transformer/metadata/TransformMetadata",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}();e.TransformMetadata=a}),define("class-transformer/metadata/MetadataStorage",["require","exports"],function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===a||"plainToClass"===a:!0!==t.options.toPlainOnly||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find(function(t){return t.options&&t.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName});return t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName}).concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),o=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||o},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a});return t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a}).reverse().concat(r.reverse())},t}();e.MetadataStorage=a}),define("class-transformer/storage",["require","exports","class-transformer/metadata/MetadataStorage"],function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultMetadataStorage=new a.MetadataStorage}),define("class-transformer/TransformOperationExecutor",["require","exports","class-transformer/storage"],function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypesMap=new Map}return t.prototype.transform=function(t,e,r,o,n,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var f=o&&"plainToClass"===this.transformationType?new o:[];return e.forEach(function(e,a){var o=t?t[a]:void 0;if(i.options.enableCircularCheck&&i.isCircular(e,s))"classToClass"===i.transformationType&&(f instanceof Set?f.add(e):f.push(e));else{var n=i.transform(o,e,r,void 0,e instanceof Map,s+1);f instanceof Set?f.add(n):f.push(n)}}),f}if(r!==String||n){if(r!==Number||n){if(r!==Boolean||n){if((r===Date||e instanceof Date)&&!n)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.options.enableCircularCheck&&this.transformedTypesMap.set(e,{level:s,object:e});var p=this.getKeys(r,e),u=t||{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(u=n?new Map:r?new r:{});for(var c=this,l=0,d=p;l<d.length;l++){var y=d[l];!function(o){var i=o,f=o,p=o;if(!c.options.ignoreDecorators&&r)if("plainToClass"===c.transformationType){var l=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,o);l&&(p=l.propertyName,f=l.propertyName)}else if("classToPlain"===c.transformationType||"classToClass"===c.transformationType){var l=a.defaultMetadataStorage.findExposeMetadata(r,o);l&&l.options&&l.options.name&&(f=l.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var y=void 0,m=d instanceof Map;if(r&&n)y=r;else if(r){var v=a.defaultMetadataStorage.findTypeMetadata(r,p);if(v){var T={newObject:u,object:e,property:p};y=v.typeFunction(T),m=m||v.reflectedType===Map}else c.options.targetMaps&&c.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[p]}).forEach(function(t){return y=t.properties[p]})}var M=e[i]instanceof Array?c.getReflectedType(r,p):void 0,h=t?t[i]:void 0;if(u.constructor.prototype){var x=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(("plainToClass"===c.transformationType||"classToClass"===c.transformationType)&&(u[f]instanceof Function||x&&!x.set))return"continue"}if(c.options.enableCircularCheck&&c.isCircular(d,s)){if("classToClass"===c.transformationType){var g=d;g=c.applyCustomTransformations(g,r,o),u instanceof Map?u.set(f,g):u[f]=g}}else{var C="plainToClass"===c.transformationType?f:o,g=c.transform(h,d,y,M,m,s+1);g=c.applyCustomTransformations(g,r,C),u instanceof Map?u.set(f,g):u[f]=g}}(y)}return u}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var o=this,n=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(n=n.filter(function(t){return!t.options||o.checkVersion(t.options.since,t.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(t){return!t.options||o.checkGroups(t.options.groups)}):n.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),n.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){var a=this.transformedTypesMap.get(t);return void 0!==a&&a.level<e},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,o=a.defaultMetadataStorage.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");var n=[];if("exposeAll"===o&&(n=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),n=n.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(n=n.filter(function(t){return-1===i.indexOf(t)})),void 0!==this.options.version&&(n=n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkVersion(o.options.since,o.options.until)})),n=this.options.groups&&this.options.groups.length?n.filter(function(e){var o=a.defaultMetadataStorage.findExposeMetadata(t,e);return!o||!o.options||r.checkGroups(o.options.groups)}):n.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(n=n.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),n=n.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return-1!==t.indexOf(e)})},t}();e.TransformOperationExecutor=r}),define("class-transformer/ClassTransformer",["require","exports","class-transformer/TransformOperationExecutor"],function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.classToPlain=function(t,e){return new a.TransformOperationExecutor("classToPlain",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToPlain",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){return new a.TransformOperationExecutor("classToClass",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToClass",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}();e.ClassTransformer=r}),define("class-transformer/decorators",["require","exports","class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e,a,r,o,n,s,i){function f(t,e){return function(a,o){var n=new i.TransformMetadata(a.constructor,o,t,e);r.defaultMetadataStorage.addTransformMetadata(n)}}function p(t){return function(e,a){var n=Reflect.getMetadata("design:type",e,a),s=new o.TypeMetadata(e.constructor,a,n,t);r.defaultMetadataStorage.addTypeMetadata(s)}}function u(t){return function(e,a){var o=new n.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExposeMetadata(o)}}function c(t){return function(e,a){var o=new s.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});r.defaultMetadataStorage.addExcludeMetadata(o)}}function l(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=s.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToPlain(r,t):r.then(function(e){return n.classToPlain(e,t)})}}}function d(t){return function(e,r,o){var n=new a.ClassTransformer,s=o.value;o.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=s.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToClass(r,t):r.then(function(e){return n.classToClass(e,t)})}}}Object.defineProperty(e,"__esModule",{value:!0}),e.Transform=f,e.Type=p,e.Expose=u,e.Exclude=c,e.TransformClassToPlain=l,e.TransformClassToClass=d}),define("class-transformer/index",["require","exports","class-transformer/ClassTransformer","class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e,a,r,o){function n(t,e){return y.classToPlain(t,e)}function s(t,e,a){return y.classToPlainFromExist(t,e,a)}function i(t,e,a){return y.plainToClass(t,e,a)}function f(t,e,a){return y.plainToClassFromExist(t,e,a)}function p(t,e){return y.classToClass(t,e)}function u(t,e,a){return y.classToClassFromExist(t,e,a)}function c(t,e){return y.serialize(t,e)}function l(t,e,a){return y.deserialize(t,e,a)}function d(t,e,a){return y.deserializeArray(t,e,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.ClassTransformer=r.ClassTransformer,function(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}(o);var y=new a.ClassTransformer;e.classToPlain=n,e.classToPlainFromExist=s,e.plainToClass=i,e.plainToClassFromExist=f,e.classToClass=p,e.classToClassFromExist=u,e.serialize=c,e.deserialize=l,e.deserializeArray=d}),define("class-transformer",["require","exports","class-transformer/index"],function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}(a)}); |
@@ -1,23 +0,23 @@ | ||
System.register("class-transformer/ClassTransformOptions", [], function(exports_1, context_1) { | ||
System.register("class-transformer/ClassTransformOptions", [], function (exports_1, context_1) { | ||
var __moduleName = context_1 && context_1.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExposeExcludeOptions", [], function(exports_2, context_2) { | ||
System.register("class-transformer/metadata/ExposeExcludeOptions", [], function (exports_2, context_2) { | ||
var __moduleName = context_2 && context_2.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/TypeMetadata", [], function(exports_3, context_3) { | ||
System.register("class-transformer/metadata/TypeMetadata", [], function (exports_3, context_3) { | ||
var __moduleName = context_3 && context_3.id; | ||
var TypeMetadata; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
TypeMetadata = (function () { | ||
@@ -34,10 +34,10 @@ function TypeMetadata(target, propertyName, reflectedType, typeFunction) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExposeMetadata", [], function(exports_4, context_4) { | ||
System.register("class-transformer/metadata/ExposeMetadata", [], function (exports_4, context_4) { | ||
var __moduleName = context_4 && context_4.id; | ||
var ExposeMetadata; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
ExposeMetadata = (function () { | ||
@@ -53,10 +53,10 @@ function ExposeMetadata(target, propertyName, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExcludeMetadata", [], function(exports_5, context_5) { | ||
System.register("class-transformer/metadata/ExcludeMetadata", [], function (exports_5, context_5) { | ||
var __moduleName = context_5 && context_5.id; | ||
var ExcludeMetadata; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
ExcludeMetadata = (function () { | ||
@@ -72,10 +72,10 @@ function ExcludeMetadata(target, propertyName, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/TransformMetadata", [], function(exports_6, context_6) { | ||
System.register("class-transformer/metadata/TransformMetadata", [], function (exports_6, context_6) { | ||
var __moduleName = context_6 && context_6.id; | ||
var TransformMetadata; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
TransformMetadata = (function () { | ||
@@ -92,10 +92,10 @@ function TransformMetadata(target, propertyName, transformFn, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/MetadataStorage", [], function(exports_7, context_7) { | ||
System.register("class-transformer/metadata/MetadataStorage", [], function (exports_7, context_7) { | ||
var __moduleName = context_7 && context_7.id; | ||
var MetadataStorage; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
/** | ||
@@ -155,4 +155,4 @@ * Storage all library metadata. | ||
MetadataStorage.prototype.findExposeMetadataByCustomName = function (target, name) { | ||
return this._exposeMetadatas.find(function (metadata) { | ||
return metadata.target === target && metadata.options && metadata.options.name === name; | ||
return this.getExposedMetadatas(target).find(function (metadata) { | ||
return metadata.options && metadata.options.name === name; | ||
}); | ||
@@ -237,14 +237,14 @@ }; | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/storage", ["class-transformer/metadata/MetadataStorage"], function(exports_8, context_8) { | ||
System.register("class-transformer/storage", ["class-transformer/metadata/MetadataStorage"], function (exports_8, context_8) { | ||
var __moduleName = context_8 && context_8.id; | ||
var MetadataStorage_1; | ||
var defaultMetadataStorage; | ||
var MetadataStorage_1, defaultMetadataStorage; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (MetadataStorage_1_1) { | ||
MetadataStorage_1 = MetadataStorage_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
/** | ||
@@ -255,14 +255,14 @@ * Default metadata storage is used as singleton and can be used to storage all metadatas. | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/TransformOperationExecutor", ["class-transformer/storage"], function(exports_9, context_9) { | ||
System.register("class-transformer/TransformOperationExecutor", ["class-transformer/storage"], function (exports_9, context_9) { | ||
var __moduleName = context_9 && context_9.id; | ||
var storage_1; | ||
var TransformOperationExecutor; | ||
var storage_1, TransformOperationExecutor; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (storage_1_1) { | ||
storage_1 = storage_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
TransformOperationExecutor = (function () { | ||
@@ -278,3 +278,3 @@ // ------------------------------------------------------------------------- | ||
// ------------------------------------------------------------------------- | ||
this.transformedTypes = []; | ||
this.transformedTypesMap = new Map(); | ||
} | ||
@@ -291,3 +291,3 @@ // ------------------------------------------------------------------------- | ||
var subSource = source ? source[index] : undefined; | ||
if (!_this.isCircular(subValue, level)) { | ||
if (!_this.options.enableCircularCheck || !_this.isCircular(subValue, level)) { | ||
var value_1 = _this.transform(subSource, subValue, targetType, undefined, subValue instanceof Map, level + 1); | ||
@@ -335,4 +335,6 @@ if (newValue_1 instanceof Set) { | ||
targetType = source.constructor; | ||
// add transformed type to prevent circular references | ||
this.transformedTypes.push({ level: level, object: value }); | ||
if (this.options.enableCircularCheck) { | ||
// add transformed type to prevent circular references | ||
this.transformedTypesMap.set(value, { level: level, object: value }); | ||
} | ||
var keys = this.getKeys(targetType, value); | ||
@@ -351,4 +353,3 @@ var newValue = source ? source : {}; | ||
} | ||
// traverse over keys | ||
var _loop_1 = function(key) { | ||
var _loop_1 = function (key) { | ||
var valueKey = key, newValueKey = key, propertyName = key; | ||
@@ -413,3 +414,3 @@ if (!this_1.options.ignoreDecorators && targetType) { | ||
} | ||
if (!this_1.isCircular(subValue, level)) { | ||
if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue, level)) { | ||
var transformKey = this_1.transformationType === "plainToClass" ? newValueKey : key; | ||
@@ -437,2 +438,3 @@ var finalValue = this_1.transform(subSource, subValue, type, arrayType_1, isSubValueMap, level + 1); | ||
var this_1 = this; | ||
// traverse over keys | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
@@ -481,3 +483,4 @@ var key = keys_1[_i]; | ||
TransformOperationExecutor.prototype.isCircular = function (object, level) { | ||
return !!this.transformedTypes.find(function (transformed) { return transformed.object === object && transformed.level < level; }); | ||
var transformed = this.transformedTypesMap.get(object); | ||
return transformed !== undefined && transformed.level < level; | ||
}; | ||
@@ -583,14 +586,14 @@ TransformOperationExecutor.prototype.getReflectedType = function (target, propertyName) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/ClassTransformer", ["class-transformer/TransformOperationExecutor"], function(exports_10, context_10) { | ||
System.register("class-transformer/ClassTransformer", ["class-transformer/TransformOperationExecutor"], function (exports_10, context_10) { | ||
var __moduleName = context_10 && context_10.id; | ||
var TransformOperationExecutor_1; | ||
var ClassTransformer; | ||
var TransformOperationExecutor_1, ClassTransformer; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (TransformOperationExecutor_1_1) { | ||
TransformOperationExecutor_1 = TransformOperationExecutor_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
ClassTransformer = (function () { | ||
@@ -644,7 +647,6 @@ function ClassTransformer() { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/decorators", ["class-transformer/ClassTransformer", "class-transformer/storage", "class-transformer/metadata/TypeMetadata", "class-transformer/metadata/ExposeMetadata", "class-transformer/metadata/ExcludeMetadata", "class-transformer/metadata/TransformMetadata"], function(exports_11, context_11) { | ||
System.register("class-transformer/decorators", ["class-transformer/ClassTransformer", "class-transformer/storage", "class-transformer/metadata/TypeMetadata", "class-transformer/metadata/ExposeMetadata", "class-transformer/metadata/ExcludeMetadata", "class-transformer/metadata/TransformMetadata"], function (exports_11, context_11) { | ||
var __moduleName = context_11 && context_11.id; | ||
var ClassTransformer_1, storage_2, TypeMetadata_1, ExposeMetadata_1, ExcludeMetadata_1, TransformMetadata_1; | ||
/** | ||
@@ -705,3 +707,3 @@ * Defines a custom logic for value transformation. | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -725,3 +727,3 @@ var result = originalMethod.apply(this, args); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -735,4 +737,5 @@ var result = originalMethod.apply(this, args); | ||
exports_11("TransformClassToClass", TransformClassToClass); | ||
var ClassTransformer_1, storage_2, TypeMetadata_1, ExposeMetadata_1, ExcludeMetadata_1, TransformMetadata_1; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (ClassTransformer_1_1) { | ||
@@ -755,11 +758,10 @@ ClassTransformer_1 = ClassTransformer_1_1; | ||
TransformMetadata_1 = TransformMetadata_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/index", ["class-transformer/ClassTransformer", "class-transformer/decorators"], function(exports_12, context_12) { | ||
System.register("class-transformer/index", ["class-transformer/ClassTransformer", "class-transformer/decorators"], function (exports_12, context_12) { | ||
var __moduleName = context_12 && context_12.id; | ||
var ClassTransformer_2; | ||
var classTransformer; | ||
function classToPlain(object, options) { | ||
@@ -807,32 +809,19 @@ return classTransformer.classToPlain(object, options); | ||
exports_12("deserializeArray", deserializeArray); | ||
var ClassTransformer_2, classTransformer; | ||
var exportedNames_1 = { | ||
'classToPlain': true, | ||
'classToPlain': true, | ||
'classToPlain': true, | ||
'classToPlainFromExist': true, | ||
'classToPlainFromExist': true, | ||
'classToPlainFromExist': true, | ||
'plainToClass': true, | ||
'plainToClass': true, | ||
'plainToClass': true, | ||
'plainToClassFromExist': true, | ||
'plainToClassFromExist': true, | ||
'plainToClassFromExist': true, | ||
'classToClass': true, | ||
'classToClass': true, | ||
'classToClass': true, | ||
'classToClassFromExist': true, | ||
'classToClassFromExist': true, | ||
'classToClassFromExist': true, | ||
'serialize': true, | ||
'serialize': true, | ||
'serialize': true, | ||
'deserialize': true, | ||
'deserializeArray': true, | ||
'ClassTransformer': true | ||
"classToPlain": true, | ||
"classToPlainFromExist": true, | ||
"plainToClass": true, | ||
"plainToClassFromExist": true, | ||
"classToClass": true, | ||
"classToClassFromExist": true, | ||
"serialize": true, | ||
"deserialize": true, | ||
"deserializeArray": true, | ||
"ClassTransformer": true | ||
}; | ||
function exportStar_1(m) { | ||
var exports = {}; | ||
for(var n in m) { | ||
if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; | ||
for (var n in m) { | ||
if (n !== "default" && !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; | ||
} | ||
@@ -842,3 +831,3 @@ exports_12(exports); | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (ClassTransformer_2_1) { | ||
@@ -852,13 +841,14 @@ ClassTransformer_2 = ClassTransformer_2_1; | ||
exportStar_1(decorators_1_1); | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
classTransformer = new ClassTransformer_2.ClassTransformer(); | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer", ["class-transformer/index"], function(exports_13, context_13) { | ||
System.register("class-transformer", ["class-transformer/index"], function (exports_13, context_13) { | ||
var __moduleName = context_13 && context_13.id; | ||
function exportStar_2(m) { | ||
var exports = {}; | ||
for(var n in m) { | ||
for (var n in m) { | ||
if (n !== "default") exports[n] = m[n]; | ||
@@ -869,9 +859,10 @@ } | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (index_1_1) { | ||
exportStar_2(index_1_1); | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); |
@@ -1,1 +0,1 @@ | ||
System.register("class-transformer/ClassTransformOptions",[],function(t,e){e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/ExposeExcludeOptions",[],function(t,e){e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/TypeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}(),t("TypeMetadata",a)}}}),System.register("class-transformer/metadata/ExposeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExposeMetadata",a)}}}),System.register("class-transformer/metadata/ExcludeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExcludeMetadata",a)}}}),System.register("class-transformer/metadata/TransformMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}(),t("TransformMetadata",a)}}}),System.register("class-transformer/metadata/MetadataStorage",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===a||"plainToClass"===a:t.options.toPlainOnly!==!0||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this._exposeMetadatas.find(function(a){return a.target===t&&a.options&&a.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName}),r=t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName});return r.concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),n=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||n},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a}),n=t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return n.reverse().concat(r.reverse())},t}(),t("MetadataStorage",a)}}}),System.register("class-transformer/storage",["class-transformer/metadata/MetadataStorage"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){t("defaultMetadataStorage",r=new a.MetadataStorage)}}}),System.register("class-transformer/TransformOperationExecutor",["class-transformer/storage"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypes=[]}return t.prototype.transform=function(t,e,r,n,o,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var u=n&&"plainToClass"===this.transformationType?new n:[];return e.forEach(function(e,a){var n=t?t[a]:void 0;if(i.isCircular(e,s))"classToClass"===i.transformationType&&(u instanceof Set?u.add(e):u.push(e));else{var o=i.transform(n,e,r,void 0,e instanceof Map,s+1);u instanceof Set?u.add(o):u.push(o)}}),u}if(r!==String||o){if(r!==Number||o){if(r!==Boolean||o){if((r===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.transformedTypes.push({level:s,object:e});var f=this.getKeys(r,e),c=t?t:{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(c=o?new Map:r?new r:{});for(var p=function(n){var i=n,u=n,f=n;if(!l.options.ignoreDecorators&&r)if("plainToClass"===l.transformationType){var p=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,n);p&&(f=p.propertyName,u=p.propertyName)}else if("classToPlain"===l.transformationType||"classToClass"===l.transformationType){var p=a.defaultMetadataStorage.findExposeMetadata(r,n);p&&p.options&&p.options.name&&(u=p.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var m=void 0,y=d instanceof Map;if(r&&o)m=r;else if(r){var T=a.defaultMetadataStorage.findTypeMetadata(r,f);if(T){var v={newObject:c,object:e,property:f};m=T.typeFunction(v),y=y||T.reflectedType===Map}else l.options.targetMaps&&l.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[f]}).forEach(function(t){return m=t.properties[f]})}var h=e[i]instanceof Array?l.getReflectedType(r,f):void 0,g=t?t[i]:void 0;if(c.constructor.prototype){var M=Object.getOwnPropertyDescriptor(c.constructor.prototype,u);if(("plainToClass"===l.transformationType||"classToClass"===l.transformationType)&&(c[u]instanceof Function||M&&!M.set))return"continue"}if(l.isCircular(d,s)){if("classToClass"===l.transformationType){var x=d;x=l.applyCustomTransformations(x,r,n),c instanceof Map?c.set(u,x):c[u]=x}}else{var C="plainToClass"===l.transformationType?u:n,x=l.transform(g,d,m,h,y,s+1);x=l.applyCustomTransformations(x,r,C),c instanceof Map?c.set(u,x):c[u]=x}},l=this,d=0,m=f;d<m.length;d++){var y=m[d];p(y)}return c}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var n=this,o=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(o=o.filter(function(t){return!t.options||n.checkVersion(t.options.since,t.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(t){return!t.options||n.checkGroups(t.options.groups)}):o.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),o.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){return!!this.transformedTypes.find(function(a){return a.object===t&&a.level<e})},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,n=a.defaultMetadataStorage.getStrategy(t);"none"===n&&(n=this.options.strategy||"exposeAll");var o=[];if("exposeAll"===n&&(o=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),o=o.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(o=o.filter(function(t){return i.indexOf(t)===-1})),void 0!==this.options.version&&(o=o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkVersion(n.options.since,n.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkGroups(n.options.groups)}):o.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(o=o.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),o=o.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return t.indexOf(e)!==-1})},t}(),t("TransformOperationExecutor",r)}}}),System.register("class-transformer/ClassTransformer",["class-transformer/TransformOperationExecutor"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(){}return t.prototype.classToPlain=function(t,e){var r=new a.TransformOperationExecutor("classToPlain",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("classToPlain",r||{});return n.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){var n=new a.TransformOperationExecutor("plainToClass",r||{});return n.transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("plainToClass",r||{});return n.transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){var r=new a.TransformOperationExecutor("classToClass",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("classToClass",r||{});return n.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}(),t("ClassTransformer",r)}}}),System.register("class-transformer/decorators",["class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e){function a(t,e){return function(a,r){var n=new d.TransformMetadata(a.constructor,r,t,e);f.defaultMetadataStorage.addTransformMetadata(n)}}function r(t){return function(e,a){var r=Reflect.getMetadata("design:type",e,a),n=new c.TypeMetadata(e.constructor,a,r,t);f.defaultMetadataStorage.addTypeMetadata(n)}}function n(t){return function(e,a){var r=new p.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExposeMetadata(r)}}function o(t){return function(e,a){var r=new l.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExcludeMetadata(r)}}function s(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=o.apply(this,e),s=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return s?r.then(function(e){return n.classToPlain(e,t)}):n.classToPlain(r,t)}}}function i(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=o.apply(this,e),s=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return s?r.then(function(e){return n.classToClass(e,t)}):n.classToClass(r,t)}}}var u,f,c,p,l,d;e&&e.id;return t("Transform",a),t("Type",r),t("Expose",n),t("Exclude",o),t("TransformClassToPlain",s),t("TransformClassToClass",i),{setters:[function(t){u=t},function(t){f=t},function(t){c=t},function(t){p=t},function(t){l=t},function(t){d=t}],execute:function(){}}}),System.register("class-transformer/index",["class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e){function a(t,e){return d.classToPlain(t,e)}function r(t,e,a){return d.classToPlainFromExist(t,e,a)}function n(t,e,a){return d.plainToClass(t,e,a)}function o(t,e,a){return d.plainToClassFromExist(t,e,a)}function s(t,e){return d.classToClass(t,e)}function i(t,e,a){return d.classToClassFromExist(t,e,a)}function u(t,e){return d.serialize(t,e)}function f(t,e,a){return d.deserialize(t,e,a)}function c(t,e,a){return d.deserializeArray(t,e,a)}function p(e){var a={};for(var r in e)"default"===r||m.hasOwnProperty(r)||(a[r]=e[r]);t(a)}var l,d;e&&e.id;t("classToPlain",a),t("classToPlainFromExist",r),t("plainToClass",n),t("plainToClassFromExist",o),t("classToClass",s),t("classToClassFromExist",i),t("serialize",u),t("deserialize",f),t("deserializeArray",c);var m={classToPlain:!0,classToPlain:!0,classToPlain:!0,classToPlainFromExist:!0,classToPlainFromExist:!0,classToPlainFromExist:!0,plainToClass:!0,plainToClass:!0,plainToClass:!0,plainToClassFromExist:!0,plainToClassFromExist:!0,plainToClassFromExist:!0,classToClass:!0,classToClass:!0,classToClass:!0,classToClassFromExist:!0,classToClassFromExist:!0,classToClassFromExist:!0,serialize:!0,serialize:!0,serialize:!0,deserialize:!0,deserializeArray:!0,ClassTransformer:!0};return{setters:[function(e){l=e,t({ClassTransformer:e.ClassTransformer})},function(t){p(t)}],execute:function(){d=new l.ClassTransformer}}}),System.register("class-transformer",["class-transformer/index"],function(t,e){function a(e){var a={};for(var r in e)"default"!==r&&(a[r]=e[r]);t(a)}e&&e.id;return{setters:[function(t){a(t)}],execute:function(){}}}); | ||
System.register("class-transformer/ClassTransformOptions",[],function(t,e){e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/ExposeExcludeOptions",[],function(t,e){e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/TypeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}(),t("TypeMetadata",a)}}}),System.register("class-transformer/metadata/ExposeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExposeMetadata",a)}}}),System.register("class-transformer/metadata/ExcludeMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExcludeMetadata",a)}}}),System.register("class-transformer/metadata/TransformMetadata",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}(),t("TransformMetadata",a)}}}),System.register("class-transformer/metadata/MetadataStorage",[],function(t,e){var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===a||"plainToClass"===a:!0!==t.options.toPlainOnly||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find(function(t){return t.options&&t.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName});return t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName}).concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),n=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||n},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a});return t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a}).reverse().concat(r.reverse())},t}(),t("MetadataStorage",a)}}}),System.register("class-transformer/storage",["class-transformer/metadata/MetadataStorage"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){t("defaultMetadataStorage",r=new a.MetadataStorage)}}}),System.register("class-transformer/TransformOperationExecutor",["class-transformer/storage"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypesMap=new Map}return t.prototype.transform=function(t,e,r,n,o,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var u=n&&"plainToClass"===this.transformationType?new n:[];return e.forEach(function(e,a){var n=t?t[a]:void 0;if(i.options.enableCircularCheck&&i.isCircular(e,s))"classToClass"===i.transformationType&&(u instanceof Set?u.add(e):u.push(e));else{var o=i.transform(n,e,r,void 0,e instanceof Map,s+1);u instanceof Set?u.add(o):u.push(o)}}),u}if(r!==String||o){if(r!==Number||o){if(r!==Boolean||o){if((r===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.options.enableCircularCheck&&this.transformedTypesMap.set(e,{level:s,object:e});var f=this.getKeys(r,e),c=t||{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(c=o?new Map:r?new r:{});for(var p=this,l=0,d=f;l<d.length;l++){var m=d[l];!function(n){var i=n,u=n,f=n;if(!p.options.ignoreDecorators&&r)if("plainToClass"===p.transformationType){var l=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,n);l&&(f=l.propertyName,u=l.propertyName)}else if("classToPlain"===p.transformationType||"classToClass"===p.transformationType){var l=a.defaultMetadataStorage.findExposeMetadata(r,n);l&&l.options&&l.options.name&&(u=l.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var m=void 0,y=d instanceof Map;if(r&&o)m=r;else if(r){var T=a.defaultMetadataStorage.findTypeMetadata(r,f);if(T){var v={newObject:c,object:e,property:f};m=T.typeFunction(v),y=y||T.reflectedType===Map}else p.options.targetMaps&&p.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[f]}).forEach(function(t){return m=t.properties[f]})}var h=e[i]instanceof Array?p.getReflectedType(r,f):void 0,M=t?t[i]:void 0;if(c.constructor.prototype){var g=Object.getOwnPropertyDescriptor(c.constructor.prototype,u);if(("plainToClass"===p.transformationType||"classToClass"===p.transformationType)&&(c[u]instanceof Function||g&&!g.set))return"continue"}if(p.options.enableCircularCheck&&p.isCircular(d,s)){if("classToClass"===p.transformationType){var x=d;x=p.applyCustomTransformations(x,r,n),c instanceof Map?c.set(u,x):c[u]=x}}else{var C="plainToClass"===p.transformationType?u:n,x=p.transform(M,d,m,h,y,s+1);x=p.applyCustomTransformations(x,r,C),c instanceof Map?c.set(u,x):c[u]=x}}(m)}return c}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var n=this,o=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(o=o.filter(function(t){return!t.options||n.checkVersion(t.options.since,t.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(t){return!t.options||n.checkGroups(t.options.groups)}):o.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),o.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){var a=this.transformedTypesMap.get(t);return void 0!==a&&a.level<e},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,n=a.defaultMetadataStorage.getStrategy(t);"none"===n&&(n=this.options.strategy||"exposeAll");var o=[];if("exposeAll"===n&&(o=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),o=o.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(o=o.filter(function(t){return-1===i.indexOf(t)})),void 0!==this.options.version&&(o=o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkVersion(n.options.since,n.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkGroups(n.options.groups)}):o.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(o=o.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),o=o.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return-1!==t.indexOf(e)})},t}(),t("TransformOperationExecutor",r)}}}),System.register("class-transformer/ClassTransformer",["class-transformer/TransformOperationExecutor"],function(t,e){var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(){}return t.prototype.classToPlain=function(t,e){return new a.TransformOperationExecutor("classToPlain",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToPlain",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){return new a.TransformOperationExecutor("classToClass",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToClass",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}(),t("ClassTransformer",r)}}}),System.register("class-transformer/decorators",["class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e){function a(t,e){return function(a,r){var n=new d.TransformMetadata(a.constructor,r,t,e);f.defaultMetadataStorage.addTransformMetadata(n)}}function r(t){return function(e,a){var r=Reflect.getMetadata("design:type",e,a),n=new c.TypeMetadata(e.constructor,a,r,t);f.defaultMetadataStorage.addTypeMetadata(n)}}function n(t){return function(e,a){var r=new p.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExposeMetadata(r)}}function o(t){return function(e,a){var r=new l.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExcludeMetadata(r)}}function s(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=o.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToPlain(r,t):r.then(function(e){return n.classToPlain(e,t)})}}}function i(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=o.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToClass(r,t):r.then(function(e){return n.classToClass(e,t)})}}}e&&e.id;t("Transform",a),t("Type",r),t("Expose",n),t("Exclude",o),t("TransformClassToPlain",s),t("TransformClassToClass",i);var u,f,c,p,l,d;return{setters:[function(t){u=t},function(t){f=t},function(t){c=t},function(t){p=t},function(t){l=t},function(t){d=t}],execute:function(){}}}),System.register("class-transformer/index",["class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e){function a(t,e){return d.classToPlain(t,e)}function r(t,e,a){return d.classToPlainFromExist(t,e,a)}function n(t,e,a){return d.plainToClass(t,e,a)}function o(t,e,a){return d.plainToClassFromExist(t,e,a)}function s(t,e){return d.classToClass(t,e)}function i(t,e,a){return d.classToClassFromExist(t,e,a)}function u(t,e){return d.serialize(t,e)}function f(t,e,a){return d.deserialize(t,e,a)}function c(t,e,a){return d.deserializeArray(t,e,a)}function p(e){var a={};for(var r in e)"default"===r||m.hasOwnProperty(r)||(a[r]=e[r]);t(a)}e&&e.id;t("classToPlain",a),t("classToPlainFromExist",r),t("plainToClass",n),t("plainToClassFromExist",o),t("classToClass",s),t("classToClassFromExist",i),t("serialize",u),t("deserialize",f),t("deserializeArray",c);var l,d,m={classToPlain:!0,classToPlainFromExist:!0,plainToClass:!0,plainToClassFromExist:!0,classToClass:!0,classToClassFromExist:!0,serialize:!0,deserialize:!0,deserializeArray:!0,ClassTransformer:!0};return{setters:[function(e){l=e,t({ClassTransformer:e.ClassTransformer})},function(t){p(t)}],execute:function(){d=new l.ClassTransformer}}}),System.register("class-transformer",["class-transformer/index"],function(t,e){function a(e){var a={};for(var r in e)"default"!==r&&(a[r]=e[r]);t(a)}e&&e.id;return{setters:[function(t){a(t)}],execute:function(){}}}); |
@@ -1,20 +0,20 @@ | ||
System.register("class-transformer/ClassTransformOptions", [], function(exports_1, context_1) { | ||
System.register("class-transformer/ClassTransformOptions", [], function (exports_1, context_1) { | ||
"use strict"; | ||
var __moduleName = context_1 && context_1.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExposeExcludeOptions", [], function(exports_2, context_2) { | ||
System.register("class-transformer/metadata/ExposeExcludeOptions", [], function (exports_2, context_2) { | ||
"use strict"; | ||
var __moduleName = context_2 && context_2.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/TypeMetadata", [], function(exports_3, context_3) { | ||
System.register("class-transformer/metadata/TypeMetadata", [], function (exports_3, context_3) { | ||
"use strict"; | ||
@@ -24,4 +24,4 @@ var __moduleName = context_3 && context_3.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
TypeMetadata = (function () { | ||
@@ -38,5 +38,5 @@ function TypeMetadata(target, propertyName, reflectedType, typeFunction) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExposeMetadata", [], function(exports_4, context_4) { | ||
System.register("class-transformer/metadata/ExposeMetadata", [], function (exports_4, context_4) { | ||
"use strict"; | ||
@@ -46,4 +46,4 @@ var __moduleName = context_4 && context_4.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
ExposeMetadata = (function () { | ||
@@ -59,5 +59,5 @@ function ExposeMetadata(target, propertyName, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/ExcludeMetadata", [], function(exports_5, context_5) { | ||
System.register("class-transformer/metadata/ExcludeMetadata", [], function (exports_5, context_5) { | ||
"use strict"; | ||
@@ -67,4 +67,4 @@ var __moduleName = context_5 && context_5.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
ExcludeMetadata = (function () { | ||
@@ -80,5 +80,5 @@ function ExcludeMetadata(target, propertyName, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/TransformMetadata", [], function(exports_6, context_6) { | ||
System.register("class-transformer/metadata/TransformMetadata", [], function (exports_6, context_6) { | ||
"use strict"; | ||
@@ -88,4 +88,4 @@ var __moduleName = context_6 && context_6.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
TransformMetadata = (function () { | ||
@@ -102,5 +102,5 @@ function TransformMetadata(target, propertyName, transformFn, options) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/metadata/MetadataStorage", [], function(exports_7, context_7) { | ||
System.register("class-transformer/metadata/MetadataStorage", [], function (exports_7, context_7) { | ||
"use strict"; | ||
@@ -110,4 +110,4 @@ var __moduleName = context_7 && context_7.id; | ||
return { | ||
setters:[], | ||
execute: function() { | ||
setters: [], | ||
execute: function () { | ||
/** | ||
@@ -167,4 +167,4 @@ * Storage all library metadata. | ||
MetadataStorage.prototype.findExposeMetadataByCustomName = function (target, name) { | ||
return this._exposeMetadatas.find(function (metadata) { | ||
return metadata.target === target && metadata.options && metadata.options.name === name; | ||
return this.getExposedMetadatas(target).find(function (metadata) { | ||
return metadata.options && metadata.options.name === name; | ||
}); | ||
@@ -249,15 +249,15 @@ }; | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/storage", ["class-transformer/metadata/MetadataStorage"], function(exports_8, context_8) { | ||
System.register("class-transformer/storage", ["class-transformer/metadata/MetadataStorage"], function (exports_8, context_8) { | ||
"use strict"; | ||
var __moduleName = context_8 && context_8.id; | ||
var MetadataStorage_1; | ||
var defaultMetadataStorage; | ||
var MetadataStorage_1, defaultMetadataStorage; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (MetadataStorage_1_1) { | ||
MetadataStorage_1 = MetadataStorage_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
/** | ||
@@ -268,15 +268,15 @@ * Default metadata storage is used as singleton and can be used to storage all metadatas. | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/TransformOperationExecutor", ["class-transformer/storage"], function(exports_9, context_9) { | ||
System.register("class-transformer/TransformOperationExecutor", ["class-transformer/storage"], function (exports_9, context_9) { | ||
"use strict"; | ||
var __moduleName = context_9 && context_9.id; | ||
var storage_1; | ||
var TransformOperationExecutor; | ||
var storage_1, TransformOperationExecutor; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (storage_1_1) { | ||
storage_1 = storage_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
TransformOperationExecutor = (function () { | ||
@@ -292,3 +292,3 @@ // ------------------------------------------------------------------------- | ||
// ------------------------------------------------------------------------- | ||
this.transformedTypes = []; | ||
this.transformedTypesMap = new Map(); | ||
} | ||
@@ -305,3 +305,3 @@ // ------------------------------------------------------------------------- | ||
var subSource = source ? source[index] : undefined; | ||
if (!_this.isCircular(subValue, level)) { | ||
if (!_this.options.enableCircularCheck || !_this.isCircular(subValue, level)) { | ||
var value_1 = _this.transform(subSource, subValue, targetType, undefined, subValue instanceof Map, level + 1); | ||
@@ -349,4 +349,6 @@ if (newValue_1 instanceof Set) { | ||
targetType = source.constructor; | ||
// add transformed type to prevent circular references | ||
this.transformedTypes.push({ level: level, object: value }); | ||
if (this.options.enableCircularCheck) { | ||
// add transformed type to prevent circular references | ||
this.transformedTypesMap.set(value, { level: level, object: value }); | ||
} | ||
var keys = this.getKeys(targetType, value); | ||
@@ -365,4 +367,3 @@ var newValue = source ? source : {}; | ||
} | ||
// traverse over keys | ||
var _loop_1 = function(key) { | ||
var _loop_1 = function (key) { | ||
var valueKey = key, newValueKey = key, propertyName = key; | ||
@@ -427,3 +428,3 @@ if (!this_1.options.ignoreDecorators && targetType) { | ||
} | ||
if (!this_1.isCircular(subValue, level)) { | ||
if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue, level)) { | ||
var transformKey = this_1.transformationType === "plainToClass" ? newValueKey : key; | ||
@@ -451,2 +452,3 @@ var finalValue = this_1.transform(subSource, subValue, type, arrayType_1, isSubValueMap, level + 1); | ||
var this_1 = this; | ||
// traverse over keys | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
@@ -495,3 +497,4 @@ var key = keys_1[_i]; | ||
TransformOperationExecutor.prototype.isCircular = function (object, level) { | ||
return !!this.transformedTypes.find(function (transformed) { return transformed.object === object && transformed.level < level; }); | ||
var transformed = this.transformedTypesMap.get(object); | ||
return transformed !== undefined && transformed.level < level; | ||
}; | ||
@@ -597,15 +600,15 @@ TransformOperationExecutor.prototype.getReflectedType = function (target, propertyName) { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/ClassTransformer", ["class-transformer/TransformOperationExecutor"], function(exports_10, context_10) { | ||
System.register("class-transformer/ClassTransformer", ["class-transformer/TransformOperationExecutor"], function (exports_10, context_10) { | ||
"use strict"; | ||
var __moduleName = context_10 && context_10.id; | ||
var TransformOperationExecutor_1; | ||
var ClassTransformer; | ||
var TransformOperationExecutor_1, ClassTransformer; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (TransformOperationExecutor_1_1) { | ||
TransformOperationExecutor_1 = TransformOperationExecutor_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
ClassTransformer = (function () { | ||
@@ -659,8 +662,7 @@ function ClassTransformer() { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/decorators", ["class-transformer/ClassTransformer", "class-transformer/storage", "class-transformer/metadata/TypeMetadata", "class-transformer/metadata/ExposeMetadata", "class-transformer/metadata/ExcludeMetadata", "class-transformer/metadata/TransformMetadata"], function(exports_11, context_11) { | ||
System.register("class-transformer/decorators", ["class-transformer/ClassTransformer", "class-transformer/storage", "class-transformer/metadata/TypeMetadata", "class-transformer/metadata/ExposeMetadata", "class-transformer/metadata/ExcludeMetadata", "class-transformer/metadata/TransformMetadata"], function (exports_11, context_11) { | ||
"use strict"; | ||
var __moduleName = context_11 && context_11.id; | ||
var ClassTransformer_1, storage_2, TypeMetadata_1, ExposeMetadata_1, ExcludeMetadata_1, TransformMetadata_1; | ||
/** | ||
@@ -721,3 +723,3 @@ * Defines a custom logic for value transformation. | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -741,3 +743,3 @@ var result = originalMethod.apply(this, args); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -751,4 +753,5 @@ var result = originalMethod.apply(this, args); | ||
exports_11("TransformClassToClass", TransformClassToClass); | ||
var ClassTransformer_1, storage_2, TypeMetadata_1, ExposeMetadata_1, ExcludeMetadata_1, TransformMetadata_1; | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (ClassTransformer_1_1) { | ||
@@ -771,12 +774,11 @@ ClassTransformer_1 = ClassTransformer_1_1; | ||
TransformMetadata_1 = TransformMetadata_1_1; | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer/index", ["class-transformer/ClassTransformer", "class-transformer/decorators"], function(exports_12, context_12) { | ||
System.register("class-transformer/index", ["class-transformer/ClassTransformer", "class-transformer/decorators"], function (exports_12, context_12) { | ||
"use strict"; | ||
var __moduleName = context_12 && context_12.id; | ||
var ClassTransformer_2; | ||
var classTransformer; | ||
function classToPlain(object, options) { | ||
@@ -824,32 +826,19 @@ return classTransformer.classToPlain(object, options); | ||
exports_12("deserializeArray", deserializeArray); | ||
var ClassTransformer_2, classTransformer; | ||
var exportedNames_1 = { | ||
'classToPlain': true, | ||
'classToPlain': true, | ||
'classToPlain': true, | ||
'classToPlainFromExist': true, | ||
'classToPlainFromExist': true, | ||
'classToPlainFromExist': true, | ||
'plainToClass': true, | ||
'plainToClass': true, | ||
'plainToClass': true, | ||
'plainToClassFromExist': true, | ||
'plainToClassFromExist': true, | ||
'plainToClassFromExist': true, | ||
'classToClass': true, | ||
'classToClass': true, | ||
'classToClass': true, | ||
'classToClassFromExist': true, | ||
'classToClassFromExist': true, | ||
'classToClassFromExist': true, | ||
'serialize': true, | ||
'serialize': true, | ||
'serialize': true, | ||
'deserialize': true, | ||
'deserializeArray': true, | ||
'ClassTransformer': true | ||
"classToPlain": true, | ||
"classToPlainFromExist": true, | ||
"plainToClass": true, | ||
"plainToClassFromExist": true, | ||
"classToClass": true, | ||
"classToClassFromExist": true, | ||
"serialize": true, | ||
"deserialize": true, | ||
"deserializeArray": true, | ||
"ClassTransformer": true | ||
}; | ||
function exportStar_1(m) { | ||
var exports = {}; | ||
for(var n in m) { | ||
if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; | ||
for (var n in m) { | ||
if (n !== "default" && !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; | ||
} | ||
@@ -859,3 +848,3 @@ exports_12(exports); | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (ClassTransformer_2_1) { | ||
@@ -869,9 +858,10 @@ ClassTransformer_2 = ClassTransformer_2_1; | ||
exportStar_1(decorators_1_1); | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
classTransformer = new ClassTransformer_2.ClassTransformer(); | ||
} | ||
} | ||
}; | ||
}); | ||
System.register("class-transformer", ["class-transformer/index"], function(exports_13, context_13) { | ||
System.register("class-transformer", ["class-transformer/index"], function (exports_13, context_13) { | ||
"use strict"; | ||
@@ -881,3 +871,3 @@ var __moduleName = context_13 && context_13.id; | ||
var exports = {}; | ||
for(var n in m) { | ||
for (var n in m) { | ||
if (n !== "default") exports[n] = m[n]; | ||
@@ -888,9 +878,10 @@ } | ||
return { | ||
setters:[ | ||
setters: [ | ||
function (index_1_1) { | ||
exportStar_2(index_1_1); | ||
}], | ||
execute: function() { | ||
} | ||
], | ||
execute: function () { | ||
} | ||
} | ||
}; | ||
}); |
@@ -1,1 +0,1 @@ | ||
System.register("class-transformer/ClassTransformOptions",[],function(t,e){"use strict";e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/ExposeExcludeOptions",[],function(t,e){"use strict";e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/TypeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}(),t("TypeMetadata",a)}}}),System.register("class-transformer/metadata/ExposeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExposeMetadata",a)}}}),System.register("class-transformer/metadata/ExcludeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExcludeMetadata",a)}}}),System.register("class-transformer/metadata/TransformMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}(),t("TransformMetadata",a)}}}),System.register("class-transformer/metadata/MetadataStorage",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===a||"plainToClass"===a:t.options.toPlainOnly!==!0||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this._exposeMetadatas.find(function(a){return a.target===t&&a.options&&a.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(t.options.toClassOnly===!0&&t.options.toPlainOnly===!0||(t.options.toClassOnly===!0?"classToClass"===e||"plainToClass"===e:t.options.toPlainOnly!==!0||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName}),r=t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName});return r.concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),n=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||n},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a}),n=t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return n.reverse().concat(r.reverse())},t}(),t("MetadataStorage",a)}}}),System.register("class-transformer/storage",["class-transformer/metadata/MetadataStorage"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){t("defaultMetadataStorage",r=new a.MetadataStorage)}}}),System.register("class-transformer/TransformOperationExecutor",["class-transformer/storage"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypes=[]}return t.prototype.transform=function(t,e,r,n,o,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var u=n&&"plainToClass"===this.transformationType?new n:[];return e.forEach(function(e,a){var n=t?t[a]:void 0;if(i.isCircular(e,s))"classToClass"===i.transformationType&&(u instanceof Set?u.add(e):u.push(e));else{var o=i.transform(n,e,r,void 0,e instanceof Map,s+1);u instanceof Set?u.add(o):u.push(o)}}),u}if(r!==String||o){if(r!==Number||o){if(r!==Boolean||o){if((r===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.transformedTypes.push({level:s,object:e});var f=this.getKeys(r,e),c=t?t:{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(c=o?new Map:r?new r:{});for(var p=function(n){var i=n,u=n,f=n;if(!l.options.ignoreDecorators&&r)if("plainToClass"===l.transformationType){var p=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,n);p&&(f=p.propertyName,u=p.propertyName)}else if("classToPlain"===l.transformationType||"classToClass"===l.transformationType){var p=a.defaultMetadataStorage.findExposeMetadata(r,n);p&&p.options&&p.options.name&&(u=p.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var m=void 0,y=d instanceof Map;if(r&&o)m=r;else if(r){var T=a.defaultMetadataStorage.findTypeMetadata(r,f);if(T){var v={newObject:c,object:e,property:f};m=T.typeFunction(v),y=y||T.reflectedType===Map}else l.options.targetMaps&&l.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[f]}).forEach(function(t){return m=t.properties[f]})}var h=e[i]instanceof Array?l.getReflectedType(r,f):void 0,g=t?t[i]:void 0;if(c.constructor.prototype){var M=Object.getOwnPropertyDescriptor(c.constructor.prototype,u);if(("plainToClass"===l.transformationType||"classToClass"===l.transformationType)&&(c[u]instanceof Function||M&&!M.set))return"continue"}if(l.isCircular(d,s)){if("classToClass"===l.transformationType){var x=d;x=l.applyCustomTransformations(x,r,n),c instanceof Map?c.set(u,x):c[u]=x}}else{var C="plainToClass"===l.transformationType?u:n,x=l.transform(g,d,m,h,y,s+1);x=l.applyCustomTransformations(x,r,C),c instanceof Map?c.set(u,x):c[u]=x}},l=this,d=0,m=f;d<m.length;d++){var y=m[d];p(y)}return c}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var n=this,o=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(o=o.filter(function(t){return!t.options||n.checkVersion(t.options.since,t.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(t){return!t.options||n.checkGroups(t.options.groups)}):o.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),o.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){return!!this.transformedTypes.find(function(a){return a.object===t&&a.level<e})},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,n=a.defaultMetadataStorage.getStrategy(t);"none"===n&&(n=this.options.strategy||"exposeAll");var o=[];if("exposeAll"===n&&(o=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),o=o.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(o=o.filter(function(t){return i.indexOf(t)===-1})),void 0!==this.options.version&&(o=o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkVersion(n.options.since,n.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkGroups(n.options.groups)}):o.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(o=o.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),o=o.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return t.indexOf(e)!==-1})},t}(),t("TransformOperationExecutor",r)}}}),System.register("class-transformer/ClassTransformer",["class-transformer/TransformOperationExecutor"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(){}return t.prototype.classToPlain=function(t,e){var r=new a.TransformOperationExecutor("classToPlain",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("classToPlain",r||{});return n.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){var n=new a.TransformOperationExecutor("plainToClass",r||{});return n.transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("plainToClass",r||{});return n.transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){var r=new a.TransformOperationExecutor("classToClass",e||{});return r.transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){var n=new a.TransformOperationExecutor("classToClass",r||{});return n.transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}(),t("ClassTransformer",r)}}}),System.register("class-transformer/decorators",["class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e){"use strict";function a(t,e){return function(a,r){var n=new d.TransformMetadata(a.constructor,r,t,e);f.defaultMetadataStorage.addTransformMetadata(n)}}function r(t){return function(e,a){var r=Reflect.getMetadata("design:type",e,a),n=new c.TypeMetadata(e.constructor,a,r,t);f.defaultMetadataStorage.addTypeMetadata(n)}}function n(t){return function(e,a){var r=new p.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExposeMetadata(r)}}function o(t){return function(e,a){var r=new l.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExcludeMetadata(r)}}function s(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=o.apply(this,e),s=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return s?r.then(function(e){return n.classToPlain(e,t)}):n.classToPlain(r,t)}}}function i(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a-0]=arguments[a];var r=o.apply(this,e),s=!!r&&("object"==typeof r||"function"==typeof r)&&"function"==typeof r.then;return s?r.then(function(e){return n.classToClass(e,t)}):n.classToClass(r,t)}}}var u,f,c,p,l,d;e&&e.id;return t("Transform",a),t("Type",r),t("Expose",n),t("Exclude",o),t("TransformClassToPlain",s),t("TransformClassToClass",i),{setters:[function(t){u=t},function(t){f=t},function(t){c=t},function(t){p=t},function(t){l=t},function(t){d=t}],execute:function(){}}}),System.register("class-transformer/index",["class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e){"use strict";function a(t,e){return d.classToPlain(t,e)}function r(t,e,a){return d.classToPlainFromExist(t,e,a)}function n(t,e,a){return d.plainToClass(t,e,a)}function o(t,e,a){return d.plainToClassFromExist(t,e,a)}function s(t,e){return d.classToClass(t,e)}function i(t,e,a){return d.classToClassFromExist(t,e,a)}function u(t,e){return d.serialize(t,e)}function f(t,e,a){return d.deserialize(t,e,a)}function c(t,e,a){return d.deserializeArray(t,e,a)}function p(e){var a={};for(var r in e)"default"===r||m.hasOwnProperty(r)||(a[r]=e[r]);t(a)}var l,d;e&&e.id;t("classToPlain",a),t("classToPlainFromExist",r),t("plainToClass",n),t("plainToClassFromExist",o),t("classToClass",s),t("classToClassFromExist",i),t("serialize",u),t("deserialize",f),t("deserializeArray",c);var m={classToPlain:!0,classToPlain:!0,classToPlain:!0,classToPlainFromExist:!0,classToPlainFromExist:!0,classToPlainFromExist:!0,plainToClass:!0,plainToClass:!0,plainToClass:!0,plainToClassFromExist:!0,plainToClassFromExist:!0,plainToClassFromExist:!0,classToClass:!0,classToClass:!0,classToClass:!0,classToClassFromExist:!0,classToClassFromExist:!0,classToClassFromExist:!0,serialize:!0,serialize:!0,serialize:!0,deserialize:!0,deserializeArray:!0,ClassTransformer:!0};return{setters:[function(e){l=e,t({ClassTransformer:e.ClassTransformer})},function(t){p(t)}],execute:function(){d=new l.ClassTransformer}}}),System.register("class-transformer",["class-transformer/index"],function(t,e){"use strict";function a(e){var a={};for(var r in e)"default"!==r&&(a[r]=e[r]);t(a)}e&&e.id;return{setters:[function(t){a(t)}],execute:function(){}}}); | ||
System.register("class-transformer/ClassTransformOptions",[],function(t,e){"use strict";e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/ExposeExcludeOptions",[],function(t,e){"use strict";e&&e.id;return{setters:[],execute:function(){}}}),System.register("class-transformer/metadata/TypeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.reflectedType=a,this.typeFunction=r}return t}(),t("TypeMetadata",a)}}}),System.register("class-transformer/metadata/ExposeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExposeMetadata",a)}}}),System.register("class-transformer/metadata/ExcludeMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a){this.target=t,this.propertyName=e,this.options=a}return t}(),t("ExcludeMetadata",a)}}}),System.register("class-transformer/metadata/TransformMetadata",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(t,e,a,r){this.target=t,this.propertyName=e,this.transformFn=a,this.options=r}return t}(),t("TransformMetadata",a)}}}),System.register("class-transformer/metadata/MetadataStorage",[],function(t,e){"use strict";var a;e&&e.id;return{setters:[],execute:function(){a=function(){function t(){this._typeMetadatas=[],this._transformMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.push(t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.push(t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.push(t)},t.prototype.findTransformMetadatas=function(t,e,a){return this.findMetadatas(this._transformMetadatas,t,e).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===a||"plainToClass"===a:!0!==t.options.toPlainOnly||"classToPlain"===a))})},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find(function(t){return t.options&&t.options.name===e})},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName}),a=this._exposeMetadatas.find(function(e){return e.target===t&&void 0===e.propertyName});return e&&a||!e&&!a?"none":e?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter(function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?"classToClass"===e||"plainToClass"===e:!0!==t.options.toPlainOnly||"classToPlain"===e))}).map(function(t){return t.propertyName})},t.prototype.clear=function(){this._typeMetadatas=[],this._exposeMetadatas=[],this._excludeMetadatas=[]},t.prototype.getMetadata=function(t,e){var a=t.filter(function(t){return t.target===e&&void 0!==t.propertyName});return t.filter(function(t){return e.prototype instanceof t.target&&void 0!==t.propertyName}).concat(a)},t.prototype.findMetadata=function(t,e,a){var r=t.find(function(t){return t.target===e&&t.propertyName===a}),n=t.find(function(t){return e.prototype instanceof t.target&&t.propertyName===a});return r||n},t.prototype.findMetadatas=function(t,e,a){var r=t.filter(function(t){return t.target===e&&t.propertyName===a});return t.filter(function(t){return e.prototype instanceof t.target&&t.propertyName===a}).reverse().concat(r.reverse())},t}(),t("MetadataStorage",a)}}}),System.register("class-transformer/storage",["class-transformer/metadata/MetadataStorage"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){t("defaultMetadataStorage",r=new a.MetadataStorage)}}}),System.register("class-transformer/TransformOperationExecutor",["class-transformer/storage"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(t,e){this.transformationType=t,this.options=e,this.transformedTypesMap=new Map}return t.prototype.transform=function(t,e,r,n,o,s){var i=this;if(void 0===s&&(s=0),e instanceof Array||e instanceof Set){var u=n&&"plainToClass"===this.transformationType?new n:[];return e.forEach(function(e,a){var n=t?t[a]:void 0;if(i.options.enableCircularCheck&&i.isCircular(e,s))"classToClass"===i.transformationType&&(u instanceof Set?u.add(e):u.push(e));else{var o=i.transform(n,e,r,void 0,e instanceof Map,s+1);u instanceof Set?u.add(o):u.push(o)}}),u}if(r!==String||o){if(r!==Number||o){if(r!==Boolean||o){if((r===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null===e||void 0===e?e:new Date(e);if(e instanceof Object){r||e.constructor===Object||(r=e.constructor),!r&&t&&(r=t.constructor),this.options.enableCircularCheck&&this.transformedTypesMap.set(e,{level:s,object:e});var f=this.getKeys(r,e),c=t||{};t||"plainToClass"!==this.transformationType&&"classToClass"!==this.transformationType||(c=o?new Map:r?new r:{});for(var p=this,l=0,d=f;l<d.length;l++){var m=d[l];!function(n){var i=n,u=n,f=n;if(!p.options.ignoreDecorators&&r)if("plainToClass"===p.transformationType){var l=a.defaultMetadataStorage.findExposeMetadataByCustomName(r,n);l&&(f=l.propertyName,u=l.propertyName)}else if("classToPlain"===p.transformationType||"classToClass"===p.transformationType){var l=a.defaultMetadataStorage.findExposeMetadata(r,n);l&&l.options&&l.options.name&&(u=l.options.name)}var d=void 0;d=e instanceof Map?e.get(i):e[i]instanceof Function?e[i]():e[i];var m=void 0,y=d instanceof Map;if(r&&o)m=r;else if(r){var T=a.defaultMetadataStorage.findTypeMetadata(r,f);if(T){var v={newObject:c,object:e,property:f};m=T.typeFunction(v),y=y||T.reflectedType===Map}else p.options.targetMaps&&p.options.targetMaps.filter(function(t){return t.target===r&&!!t.properties[f]}).forEach(function(t){return m=t.properties[f]})}var h=e[i]instanceof Array?p.getReflectedType(r,f):void 0,M=t?t[i]:void 0;if(c.constructor.prototype){var g=Object.getOwnPropertyDescriptor(c.constructor.prototype,u);if(("plainToClass"===p.transformationType||"classToClass"===p.transformationType)&&(c[u]instanceof Function||g&&!g.set))return"continue"}if(p.options.enableCircularCheck&&p.isCircular(d,s)){if("classToClass"===p.transformationType){var x=d;x=p.applyCustomTransformations(x,r,n),c instanceof Map?c.set(u,x):c[u]=x}}else{var C="plainToClass"===p.transformationType?u:n,x=p.transform(M,d,m,h,y,s+1);x=p.applyCustomTransformations(x,r,C),c instanceof Map?c.set(u,x):c[u]=x}}(m)}return c}return e}return Boolean(e)}return Number(e)}return String(e)},t.prototype.applyCustomTransformations=function(t,e,r){var n=this,o=a.defaultMetadataStorage.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(o=o.filter(function(t){return!t.options||n.checkVersion(t.options.since,t.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(t){return!t.options||n.checkGroups(t.options.groups)}):o.filter(function(t){return!t.options||!t.options.groups||!t.options.groups.length}),o.forEach(function(e){t=e.transformFn(t)}),t},t.prototype.isCircular=function(t,e){var a=this.transformedTypesMap.get(t);return void 0!==a&&a.level<e},t.prototype.getReflectedType=function(t,e){if(t){var r=a.defaultMetadataStorage.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e){var r=this,n=a.defaultMetadataStorage.getStrategy(t);"none"===n&&(n=this.options.strategy||"exposeAll");var o=[];if("exposeAll"===n&&(o=e instanceof Map?Array.from(e.keys()):Object.keys(e)),!this.options.ignoreDecorators&&t){var s=a.defaultMetadataStorage.getExposedProperties(t,this.transformationType);"plainToClass"===this.transformationType&&(s=s.map(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e})),o=o.concat(s);var i=a.defaultMetadataStorage.getExcludedProperties(t,this.transformationType);i.length>0&&(o=o.filter(function(t){return-1===i.indexOf(t)})),void 0!==this.options.version&&(o=o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkVersion(n.options.since,n.options.until)})),o=this.options.groups&&this.options.groups.length?o.filter(function(e){var n=a.defaultMetadataStorage.findExposeMetadata(t,e);return!n||!n.options||r.checkGroups(n.options.groups)}):o.filter(function(e){var r=a.defaultMetadataStorage.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(o=o.filter(function(t){return r.options.excludePrefixes.every(function(e){return t.substr(0,e.length)!==e})})),o=o.filter(function(t,e,a){return a.indexOf(t)===e})},t.prototype.checkVersion=function(t,e){var a=!0;return a&&t&&(a=this.options.version>=t),a&&e&&(a=this.options.version<e),a},t.prototype.checkGroups=function(t){return!t||this.options.groups.some(function(e){return-1!==t.indexOf(e)})},t}(),t("TransformOperationExecutor",r)}}}),System.register("class-transformer/ClassTransformer",["class-transformer/TransformOperationExecutor"],function(t,e){"use strict";var a,r;e&&e.id;return{setters:[function(t){a=t}],execute:function(){r=function(){function t(){}return t.prototype.classToPlain=function(t,e){return new a.TransformOperationExecutor("classToPlain",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToPlain",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToClass=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("plainToClass",r||{}).transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.classToClass=function(t,e){return new a.TransformOperationExecutor("classToClass",e||{}).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){return new a.TransformOperationExecutor("classToClass",r||{}).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.classToPlain(t,e))},t.prototype.deserialize=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t.prototype.deserializeArray=function(t,e,a){var r=JSON.parse(e);return this.plainToClass(t,r,a)},t}(),t("ClassTransformer",r)}}}),System.register("class-transformer/decorators",["class-transformer/ClassTransformer","class-transformer/storage","class-transformer/metadata/TypeMetadata","class-transformer/metadata/ExposeMetadata","class-transformer/metadata/ExcludeMetadata","class-transformer/metadata/TransformMetadata"],function(t,e){"use strict";function a(t,e){return function(a,r){var n=new d.TransformMetadata(a.constructor,r,t,e);f.defaultMetadataStorage.addTransformMetadata(n)}}function r(t){return function(e,a){var r=Reflect.getMetadata("design:type",e,a),n=new c.TypeMetadata(e.constructor,a,r,t);f.defaultMetadataStorage.addTypeMetadata(n)}}function n(t){return function(e,a){var r=new p.ExposeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExposeMetadata(r)}}function o(t){return function(e,a){var r=new l.ExcludeMetadata(e instanceof Function?e:e.constructor,a,t||{});f.defaultMetadataStorage.addExcludeMetadata(r)}}function s(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=o.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToPlain(r,t):r.then(function(e){return n.classToPlain(e,t)})}}}function i(t){return function(e,a,r){var n=new u.ClassTransformer,o=r.value;r.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var r=o.apply(this,e);return!r||"object"!=typeof r&&"function"!=typeof r||"function"!=typeof r.then?n.classToClass(r,t):r.then(function(e){return n.classToClass(e,t)})}}}e&&e.id;t("Transform",a),t("Type",r),t("Expose",n),t("Exclude",o),t("TransformClassToPlain",s),t("TransformClassToClass",i);var u,f,c,p,l,d;return{setters:[function(t){u=t},function(t){f=t},function(t){c=t},function(t){p=t},function(t){l=t},function(t){d=t}],execute:function(){}}}),System.register("class-transformer/index",["class-transformer/ClassTransformer","class-transformer/decorators"],function(t,e){"use strict";function a(t,e){return d.classToPlain(t,e)}function r(t,e,a){return d.classToPlainFromExist(t,e,a)}function n(t,e,a){return d.plainToClass(t,e,a)}function o(t,e,a){return d.plainToClassFromExist(t,e,a)}function s(t,e){return d.classToClass(t,e)}function i(t,e,a){return d.classToClassFromExist(t,e,a)}function u(t,e){return d.serialize(t,e)}function f(t,e,a){return d.deserialize(t,e,a)}function c(t,e,a){return d.deserializeArray(t,e,a)}function p(e){var a={};for(var r in e)"default"===r||m.hasOwnProperty(r)||(a[r]=e[r]);t(a)}e&&e.id;t("classToPlain",a),t("classToPlainFromExist",r),t("plainToClass",n),t("plainToClassFromExist",o),t("classToClass",s),t("classToClassFromExist",i),t("serialize",u),t("deserialize",f),t("deserializeArray",c);var l,d,m={classToPlain:!0,classToPlainFromExist:!0,plainToClass:!0,plainToClassFromExist:!0,classToClass:!0,classToClassFromExist:!0,serialize:!0,deserialize:!0,deserializeArray:!0,ClassTransformer:!0};return{setters:[function(e){l=e,t({ClassTransformer:e.ClassTransformer})},function(t){p(t)}],execute:function(){d=new l.ClassTransformer}}}),System.register("class-transformer",["class-transformer/index"],function(t,e){"use strict";function a(e){var a={};for(var r in e)"default"!==r&&(a[r]=e[r]);t(a)}e&&e.id;return{setters:[function(t){a(t)}],execute:function(){}}}); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformOperationExecutor_1 = require("./TransformOperationExecutor"); | ||
@@ -3,0 +4,0 @@ var ClassTransformer = (function () { |
@@ -51,2 +51,7 @@ /** | ||
targetMaps?: TargetMap[]; | ||
/** | ||
* If set to true then class transformer will perform a circular check. (circular check is turned off by default) | ||
* This option is useful when you know for sure that your types might have a circular dependency. | ||
*/ | ||
enableCircularCheck?: boolean; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=ClassTransformOptions.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ClassTransformer_1 = require("./ClassTransformer"); | ||
@@ -63,3 +64,3 @@ var storage_1 = require("./storage"); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -83,3 +84,3 @@ var result = originalMethod.apply(this, args); | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i - 0] = arguments[_i]; | ||
args[_i] = arguments[_i]; | ||
} | ||
@@ -86,0 +87,0 @@ var result = originalMethod.apply(this, args); |
@@ -5,2 +5,3 @@ "use strict"; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ClassTransformer_1 = require("./ClassTransformer"); | ||
@@ -7,0 +8,0 @@ var ClassTransformer_2 = require("./ClassTransformer"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExcludeMetadata = (function () { | ||
@@ -3,0 +4,0 @@ function ExcludeMetadata(target, propertyName, options) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=ExposeExcludeOptions.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ExposeMetadata = (function () { | ||
@@ -3,0 +4,0 @@ function ExposeMetadata(target, propertyName, options) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -56,4 +57,4 @@ * Storage all library metadata. | ||
MetadataStorage.prototype.findExposeMetadataByCustomName = function (target, name) { | ||
return this._exposeMetadatas.find(function (metadata) { | ||
return metadata.target === target && metadata.options && metadata.options.name === name; | ||
return this.getExposedMetadatas(target).find(function (metadata) { | ||
return metadata.options && metadata.options.name === name; | ||
}); | ||
@@ -60,0 +61,0 @@ }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TransformMetadata = (function () { | ||
@@ -3,0 +4,0 @@ function TransformMetadata(target, propertyName, transformFn, options) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TypeMetadata = (function () { | ||
@@ -3,0 +4,0 @@ function TypeMetadata(target, propertyName, reflectedType, typeFunction) { |
{ | ||
"name": "class-transformer", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors", | ||
@@ -33,2 +33,3 @@ "license": "MIT", | ||
"@types/node": "0.0.2", | ||
"@types/sinon": "^2.2.2", | ||
"chai": "^3.4.1", | ||
@@ -35,0 +36,0 @@ "chai-as-promised": "^6.0.0", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataStorage_1 = require("./metadata/MetadataStorage"); | ||
@@ -3,0 +4,0 @@ /** |
@@ -6,3 +6,3 @@ import { ClassTransformOptions } from "./ClassTransformOptions"; | ||
private options; | ||
private transformedTypes; | ||
private transformedTypesMap; | ||
constructor(transformationType: TransformationType, options: ClassTransformOptions); | ||
@@ -9,0 +9,0 @@ transform(source: Object | Object[] | any, value: Object | Object[] | any, targetType: Function, arrayType: Function, isMap: boolean, level?: number): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var storage_1 = require("./storage"); | ||
@@ -13,3 +14,3 @@ var TransformOperationExecutor = (function () { | ||
// ------------------------------------------------------------------------- | ||
this.transformedTypes = []; | ||
this.transformedTypesMap = new Map(); | ||
} | ||
@@ -26,3 +27,3 @@ // ------------------------------------------------------------------------- | ||
var subSource = source ? source[index] : undefined; | ||
if (!_this.isCircular(subValue, level)) { | ||
if (!_this.options.enableCircularCheck || !_this.isCircular(subValue, level)) { | ||
var value_1 = _this.transform(subSource, subValue, targetType, undefined, subValue instanceof Map, level + 1); | ||
@@ -70,4 +71,6 @@ if (newValue_1 instanceof Set) { | ||
targetType = source.constructor; | ||
// add transformed type to prevent circular references | ||
this.transformedTypes.push({ level: level, object: value }); | ||
if (this.options.enableCircularCheck) { | ||
// add transformed type to prevent circular references | ||
this.transformedTypesMap.set(value, { level: level, object: value }); | ||
} | ||
var keys = this.getKeys(targetType, value); | ||
@@ -86,4 +89,3 @@ var newValue = source ? source : {}; | ||
} | ||
// traverse over keys | ||
var _loop_1 = function(key) { | ||
var _loop_1 = function (key) { | ||
var valueKey = key, newValueKey = key, propertyName = key; | ||
@@ -148,3 +150,3 @@ if (!this_1.options.ignoreDecorators && targetType) { | ||
} | ||
if (!this_1.isCircular(subValue, level)) { | ||
if (!this_1.options.enableCircularCheck || !this_1.isCircular(subValue, level)) { | ||
var transformKey = this_1.transformationType === "plainToClass" ? newValueKey : key; | ||
@@ -172,2 +174,3 @@ var finalValue = this_1.transform(subSource, subValue, type, arrayType_1, isSubValueMap, level + 1); | ||
var this_1 = this; | ||
// traverse over keys | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
@@ -216,3 +219,4 @@ var key = keys_1[_i]; | ||
TransformOperationExecutor.prototype.isCircular = function (object, level) { | ||
return !!this.transformedTypes.find(function (transformed) { return transformed.object === object && transformed.level < level; }); | ||
var transformed = this.transformedTypesMap.get(object); | ||
return transformed !== undefined && transformed.level < level; | ||
}; | ||
@@ -219,0 +223,0 @@ TransformOperationExecutor.prototype.getReflectedType = function (target, propertyName) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360755
4145
30