mindee
Version:
Mindee Client Library for Node.js
23 lines (22 loc) • 773 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Base64Input = void 0;
const localInputSource_1 = require("./localInputSource");
const inputSource_1 = require("./inputSource");
class Base64Input extends localInputSource_1.LocalInputSource {
constructor({ inputString, filename }) {
super({
inputType: inputSource_1.INPUT_TYPE_BASE64,
});
this.fileObject = Buffer.alloc(0);
this.filename = filename;
this.inputString = inputString;
}
async init() {
this.fileObject = Buffer.from(this.inputString, "base64");
this.mimeType = await this.checkMimetype();
// clear out the string
this.inputString = "";
}
}
exports.Base64Input = Base64Input;