UNPKG

@svelkit/hooks

Version:

> common hooks for [svelte] (part of [svelkit])

3 lines (2 loc) 282 B
const u=()=>Math.random().toString(36).slice(2),s=t=>t.replace(/\s+/g,"_");function d(t=""){const r=u(),c=t&&`~${s(t)}`,o=new Map;return(...i)=>{const e=i.join("~");let n=o.get(e);return n||o.set(e,n=`${c}~${s(e)}~${r}`),n}}export{d as useAutoId}; //# sourceMappingURL=hooks.js.map