UNPKG

@alizeait/unflatto

Version:

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

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