mindee
Version:
Mindee Client Library for Node.js
25 lines (24 loc) • 780 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BufferInput = void 0;
const localInputSource_1 = require("./localInputSource");
const inputSource_1 = require("./inputSource");
const logger_1 = require("../../logger");
class BufferInput extends localInputSource_1.LocalInputSource {
constructor({ buffer, filename }) {
super({
inputType: inputSource_1.INPUT_TYPE_BUFFER,
});
this.fileObject = buffer;
this.filename = filename;
}
async init() {
if (this.initialized) {
return;
}
logger_1.logger.debug("Loading from buffer");
this.mimeType = await this.checkMimetype();
this.initialized = true;
}
}
exports.BufferInput = BufferInput;