mindee
Version:
Mindee Client Library for Node.js
23 lines (22 loc) • 769 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BytesInput = void 0;
const inputSource_1 = require("./inputSource");
const localInputSource_1 = require("./localInputSource");
class BytesInput extends localInputSource_1.LocalInputSource {
constructor({ inputBytes, filename }) {
super({
inputType: inputSource_1.INPUT_TYPE_BYTES,
});
this.fileObject = Buffer.alloc(0);
this.filename = filename;
this.inputBytes = inputBytes;
}
async init() {
this.fileObject = Buffer.from(this.inputBytes);
this.mimeType = await this.checkMimetype();
this.inputBytes = new Uint8Array(0);
this.initialized = true;
}
}
exports.BytesInput = BytesInput;