You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package query-string is generating objects that have no prototype by using Object.create(null).
I want to deep merge with those objects, but icepick is not thinking they are objects because the isObject test check for prototype.
import{merge}from'icepick';// build object like query-string doesletquery=Object.create(null);query['q']='search-term';constroute={url: './',query: query};// prepare action for historyconstnextPage=merge(route,{query: {page: 2}});// what I expect to be the resultassert.same(nextPage,{url: './',query: {q: 'search-term',page: 2}});
The text was updated successfully, but these errors were encountered:
Ah fascinating! Looks like I could easily change isObject to accept objects with null prototypes, but it might be trickier to return an object that also has a null prototype. Would it be okay to create a vanilla object when it clones?
The package query-string is generating objects that have no prototype by using
Object.create(null)
.I want to deep merge with those objects, but icepick is not thinking they are objects because the
isObject
test check for prototype.The text was updated successfully, but these errors were encountered: