get.js 254 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 export default function get(entity, path) { var current = entity; for (var i = 0; i < path.length; i += 1) { if (current === null || current === undefined) { return undefined; } current = current[path[i]]; } return current; }