- when including elements from an array of pointers, filters unaccessible/missing objects
This commit is contained in:
Florent Vilmart
2016-03-31 20:24:18 -04:00
parent 431d864ac3
commit edfa4092c0
2 changed files with 48 additions and 2 deletions

View File

@@ -537,7 +537,8 @@ function findPointers(object, path) {
// pointers inflated.
function replacePointers(object, path, replace) {
if (object instanceof Array) {
return object.map((obj) => replacePointers(obj, path, replace));
return object.map((obj) => replacePointers(obj, path, replace))
.filter((obj) => obj != null && obj != undefined);
}
if (typeof object !== 'object') {