Commit 218d38e2 by Vladislav Lagunov

Фикс бага в functions/get-at.ts

parent 96dbbfed
...@@ -18,7 +18,7 @@ export default function getAt<R=any>(at_: ObjectPath): <A>(a: A) => R { ...@@ -18,7 +18,7 @@ export default function getAt<R=any>(at_: ObjectPath): <A>(a: A) => R {
return a => { return a => {
let iter = a as any; let iter = a as any;
for (const k of at) { for (const k of at) {
if (!iter.hasOwnProperty(k)) return undefined as any as R; // Поле отсутствует if (!iter || !iter.hasOwnProperty(k)) return undefined as any as R; // Поле отсутствует
// @ts-ignore // @ts-ignore
iter = iter[k]; iter = iter[k];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment