UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

19 lines (16 loc) 366 B
/*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ "use strict"; (() => { // src/cacheStringFunc.ts function cacheStringFunction(fn) { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; } })();