UNPKG

payload

Version:

Node, React, Headless CMS and Application Framework built on Next.js

9 lines (8 loc) 298 B
export const getObjectDotNotation = (obj, path, defaultValue)=>{ if (!path || !obj) { return defaultValue; } const result = path.split('.').reduce((o, i)=>o?.[i], obj); return result === undefined ? defaultValue : result; }; //# sourceMappingURL=getObjectDotNotation.js.map