jats-xml
Version:
Types and utilities for working with JATS in Typescript
27 lines (26 loc) • 772 B
JavaScript
import { chalkLogger, LogLevel } from 'myst-cli-utils';
function xmllintLogWrapper(logger) {
return {
...logger,
error(data) {
const line = data.trim();
if (!line)
return;
if (line.includes('warning: failed to load external entity'))
return;
logger.error(data);
},
};
}
export class Session {
constructor(opts) {
var _a;
this.log = xmllintLogWrapper((_a = opts === null || opts === void 0 ? void 0 : opts.logger) !== null && _a !== void 0 ? _a : chalkLogger(LogLevel.debug));
}
fetch() {
throw new Error('fetch not implemented on session');
}
}
export function getSession(logger) {
return new Session({ logger });
}