oazapfts
Version:
OpenApi TypeScript client generator
63 lines (62 loc) • 1.46 kB
JavaScript
import { AsyncSeriesBailHook as e, AsyncSeriesHook as t, AsyncSeriesWaterfallHook as n, SyncWaterfallHook as r } from "tapable";
//#region src/plugin.ts
var i = /* @__PURE__ */ function(e) {
return e.EAGER = "eager", e.DEFAULT = "default", e.LAZY = "lazy", e;
}({});
function a(e, t = {}) {
return Object.assign(e, t);
}
function o() {
return {
prepare: new t(["ctx"], "prepare"),
filterEndpoint: new r([
"generate",
"endpoint",
"ctx"
], "filterEndpoint"),
generateMethod: new e(["endpoint", "ctx"], "generateMethod"),
refineMethod: new n([
"methods",
"endpoint",
"ctx"
], "refineMethod"),
composeSource: new e(["ctx", "methods"], "composeSource"),
refineSource: new n([
"statements",
"ctx",
"methods"
], "refineSource"),
querySerializerArgs: new r([
"args",
"queryContext",
"ctx"
], "querySerializerArgs"),
astGenerated: new n(["ast", "ctx"], "astGenerated")
};
}
async function s(e, t) {
for (let n of c(t)) await n(e);
}
function c(e) {
let t = [], n = [], r = [];
for (let a of e) switch (a.precedence) {
case i.EAGER:
t.push(a);
break;
case i.LAZY:
r.push(a);
break;
case i.DEFAULT:
default:
n.push(a);
break;
}
return [
...t,
...n,
...r
];
}
//#endregion
export { i as UNSTABLE_OAZAPFTS_PLUGIN_PRECEDENCE, s as UNSTABLE_applyPlugins, o as UNSTABLE_createHooks, a as UNSTABLE_createPlugin, c as UNSTABLE_sortPlugins };
//# sourceMappingURL=plugin.js.map