Closed
Description
This may be a dumb question, but afaik, I don't think there's an API for this. It'd be great if there is Iterable.hasIn()
can take in an array to check if a key path exists.
Iterable.has()
can't be patched since an array is a valid key.
At the moment, I'm doing something like this:
function pathExists(iterable, path) {
if(iterable.getIn(path)) {
return true;
}
var notSetValue = true;
return !(iterable.getIn(path, notSetValue) === notSetValue);
}
Metadata
Metadata
Assignees
Labels
No labels