docutils-ts
Version:
Port of the Python Docutils library to TypeScript
25 lines (24 loc) • 714 B
JavaScript
import TransformSpec from '../transformSpec.js';
class Input extends TransformSpec {
constructor(args) {
super({ logger: args.logger });
this.componentType = "input";
this.supported = [];
const { source, sourcePath, encoding, errorHandler } = args;
this.encoding = encoding;
this.errorHandler = errorHandler;
this.source = source;
this.sourcePath = sourcePath;
if (!sourcePath) {
this.sourcePath = this.defaultSourcePath;
}
this.successfulEncoding = undefined;
}
decode(data) {
return data;
}
toString() {
return `Input<${this.constructor.name}>`;
}
}
export default Input;