UNPKG

@nestjs/class-transformer

Version:

Fork of the class-transformer package. Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors

21 lines 629 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transform = void 0; const storage_1 = require("../storage"); /** * Defines a custom logic for value transformation. * * Can be applied to properties only. */ function Transform(transformFn, options = {}) { return function (target, propertyName) { storage_1.defaultMetadataStorage.addTransformMetadata({ target: target.constructor, propertyName: propertyName, transformFn, options, }); }; } exports.Transform = Transform; //# sourceMappingURL=transform.decorator.js.map