genezio
Version:
Command line utility to interact with Genezio infrastructure.
17 lines (16 loc) • 488 B
JavaScript
import { UserError } from "../errors.js";
export class BundlerComposer {
constructor(bundlers) {
this.bundlers = bundlers;
}
async bundle(input) {
if (this.bundlers.length === 0) {
throw new UserError("Invalid number of bundlers.");
}
let arg = await this.bundlers[0].bundle(input);
for (let i = 1; i < this.bundlers.length; i++) {
arg = await this.bundlers[i].bundle(arg);
}
return arg;
}
}