UNPKG

einvoicing

Version:

A JavaScript library for creating and parsing electronic invoices compliant with the eInvoicing Directive, EN 16931, and popular extensions

33 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); /** * BinaryObject.ts * * @copyright Vitalii Savchuk <esvit666@gmail.com> * @package esvit/einvoicing * @licence MIT https://opensource.org/licenses/MIT */ var ValueObject_1 = require("../base/ValueObject"); var BinaryObject = /** @class */ (function (_super) { tslib_1.__extends(BinaryObject, _super); function BinaryObject() { return _super !== null && _super.apply(this, arguments) || this; } BinaryObject.create = function (ref) { return new BinaryObject(ref); }; BinaryObject.createFromBase64 = function (ref) { return new BinaryObject({ filename: ref.filename, mimeCode: ref.mimeCode, content: ref.base64 ? atob(ref.base64) : undefined }); }; BinaryObject.prototype.toPrimitive = function () { return this.props; }; return BinaryObject; }(ValueObject_1.ValueObject)); exports.default = BinaryObject; //# sourceMappingURL=BinaryObject.js.map