UNPKG

@alizeait/unflatto

Version:

A tiny (~210B) and fast flattened object expander, unflattener

3 lines (2 loc) 319 B
function n(n){const t=(n+"").charCodeAt(0);return t<48||t>57?{}:[]}function t(t,r){let o,e,i,c,f,u,l,h=0;for(e in r=r||".",t)for(h=0,u="",i=e.split(r),c=o||n(i[0]),o=o||c;h<i.length;h++)f=u||i[h],u=i[h+1],f in c?c=c[f]:(l=u?n(u):t[e],c[f]=l,c=l);return o}export{t as unflatto}; //# sourceMappingURL=index.modern.js.map