This commit is contained in:
Dragory 2020-09-23 20:19:21 +03:00
parent 205f7721ea
commit 4ccf1c57d2
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -347,6 +347,7 @@ export function get(obj, path, def?): any {
let cursor = obj;
const pathParts = path.split(".");
for (const part of pathParts) {
if (!cursor.hasOwnProperty(part)) return def;
cursor = cursor[part];
if (cursor === undefined) return def;
if (cursor == null) return null;