Files
starface-outlook-sync-addin/node_modules/@jsonjoy.com/codegen/lib/switch.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

16 lines
504 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSwitch = void 0;
const dynamicFunction_1 = require("./dynamicFunction");
const createSwitch = (fn, codegen) => {
let counter = 0;
const [proxy, set] = (0, dynamicFunction_1.dynamicFunction)((...args) => {
if (counter > 2)
set(codegen());
counter++;
return fn(...args);
});
return proxy;
};
exports.createSwitch = createSwitch;
//# sourceMappingURL=switch.js.map