Commit 96dbbfed by Vladislav Lagunov

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

parent 55641b43
...@@ -16,7 +16,7 @@ export type ObjectPath = ObjectKey|ObjectKey[]; ...@@ -16,7 +16,7 @@ export type ObjectPath = ObjectKey|ObjectKey[];
export default function getAt<R=any>(at_: ObjectPath): <A>(a: A) => R { export default function getAt<R=any>(at_: ObjectPath): <A>(a: A) => R {
const at = Array.isArray(at_) ? at_ : [at_]; const at = Array.isArray(at_) ? at_ : [at_];
return a => { return a => {
let iter = a as any as R; 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.hasOwnProperty(k)) return undefined as any as R; // Поле отсутствует
// @ts-ignore // @ts-ignore
......
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