MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / withModifiers

Function withModifiers

web/main.js:7498–7509  ·  view source on GitHub ↗
(fn, modifiers)

Source from the content-addressed store, hash-verified

7496 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
7497};
7498const withModifiers = (fn, modifiers) => {
7499 if (!fn) return fn;
7500 const cache = fn._withMods || (fn._withMods = {});
7501 const cacheKey = modifiers.join(".");
7502 return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
7503 for (let i = 0; i < modifiers.length; i++) {
7504 const guard = modifierGuards[modifiers[i]];
7505 if (guard && guard(event, modifiers)) return;
7506 }
7507 return fn(event, ...args);
7508 }));
7509};
7510const keyNames = {
7511 esc: "escape",
7512 space: " ",

Callers 1

setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected