Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. export function _get(object, path, fallback) {
  2. const value = path.split(".").reduce((hash, field) => hash && hash[field], object);
  3. return typeof value === "undefined" ? fallback : value;
  4. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement