@enspirit/emb
Version:
A replacement for our Makefile-for-monorepos
17 lines (16 loc) • 483 B
JavaScript
import { getContext } from '../../index.js';
export class AbstractOperation {
inputSchema;
context;
constructor(inputSchema) {
this.inputSchema = inputSchema;
if (!inputSchema) {
throw new Error(`${this.constructor.name} does not call super() with validation schema`);
}
this.context = getContext();
}
async run(input) {
const dressed = this.inputSchema.parse(input);
return this._run(dressed);
}
}