Skip to content

Commit

Permalink
Remove behavior in getObjectProperty where it yells if the value is u…
Browse files Browse the repository at this point in the history
…ndefined, that's fine.

Part of #50.
  • Loading branch information
jkomoros committed Jul 23, 2023
1 parent 268e581 commit 61a4c0a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const getObjectProperty = (obj : NormalObject, path : string) : unknown =
//if obj is an array then a get of a key like `1` will work as expected
//thanks to the weird way that javascript handles arrays.
const subObj = obj[parts[0]];
if (subObj === undefined) throw new Error(`obj had no property ${parts[0]}`);
if (parts.length > 1) {
return getObjectProperty(subObj as NormalObject, parts.slice(1).join('.'));
}
Expand Down

0 comments on commit 61a4c0a

Please sign in to comment.