Packages
A spellchecker for Elixir, made with Bun and cspell
Current section
Files
Jump to
Current section
Files
priv/bun/node_modules/cspell-lib/dist/lib/util/memorizeLastCall.js
import { isArrayEqual } from './util.js';
export function memorizeLastCall(fn) {
let last;
return (...p) => {
if (last && isArrayEqual(last.args, p)) {
return last.value;
}
const args = p;
const value = fn(...args);
last = { args, value };
return value;
};
}
//# sourceMappingURL=memorizeLastCall.js.map