@yamamotok/dataobject
Version:
Decorator based JSON serializer and deserializer.
26 lines • 750 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Strategy = exports.Transformed = void 0;
const DataObjectError_1 = require("../DataObjectError");
class Transformed {
constructor(value) {
this.value = value;
}
}
exports.Transformed = Transformed;
class Strategy {
constructor(recurse) {
this._recurse = recurse;
}
recurse(opts) {
if (!this._recurse) {
throw new DataObjectError_1.DataObjectError('Cannot recurse, no function was given to constructor');
}
return this._recurse(opts);
}
apply(opts) {
return this.transform(opts);
}
}
exports.Strategy = Strategy;
//# sourceMappingURL=Strategy.js.map