UNPKG

transformable

Version:

Transforms plain objects to class instances and vice versa (a lightweight alternative to 'class-transformer')

17 lines 608 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transformable = void 0; const functions_1 = require("./functions"); class Transformable { static fromPlain(sourceObject, sourceContext) { return (0, functions_1.plainToInstance)(sourceObject, this, sourceContext); } toPlain(targetContext) { return (0, functions_1.instanceToPlain)(this, targetContext); } toJSON(targetContext) { return (0, functions_1.instanceToPlain)(this, targetContext); } } exports.Transformable = Transformable; //# sourceMappingURL=transformable.js.map