UNPKG

typedash

Version:

modern, type-safe collection of utility functions

18 lines (16 loc) 334 B
'use strict'; // src/functions/once/once.ts function once(fn) { let result; let hasBeenCalled = false; return (...args) => { if (!hasBeenCalled) { result = fn(...args); hasBeenCalled = true; } return result; }; } exports.once = once; //# sourceMappingURL=out.js.map //# sourceMappingURL=index.cjs.map