fixing pretty print issue. AND making it so it only looks for object's own properties when doing getAt
This commit is contained in:
parent
3132b79aae
commit
6acec5641c
2 changed files with 4 additions and 1 deletions
|
|
@ -112,6 +112,7 @@ export const _rt = {
|
|||
let obj: any = store[path[0]];
|
||||
for (let i = 1; i < path.length; i++) {
|
||||
if (obj === undefined || obj === null) return { _tag: 'None' };
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, path[i])) return { _tag: 'None' };
|
||||
obj = obj[path[i]];
|
||||
}
|
||||
return obj === undefined ? { _tag: 'None' } : { _tag: 'Some', _0: obj };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue