{"version":3,"sources":["../../src/utilities/getObjectDotNotation.ts"],"sourcesContent":["/**\n *\n * @deprecated use getObjectDotNotation from `'payload/shared'` instead of `'payload'`\n *\n * @example\n *\n * ```ts\n * import { getObjectDotNotation } from 'payload/shared'\n *\n * const obj = { a: { b: { c: 42 } } }\n * const value = getObjectDotNotation(obj, 'a.b.c', 0) // value is 42\n * const defaultValue = getObjectDotNotation(obj, 'a.b.x', 0) // defaultValue is 0\n * ```\n */\nexport const getObjectDotNotation = (\n obj: Record,\n path: string,\n defaultValue?: T,\n): T => {\n if (!path || !obj) {\n return defaultValue!\n }\n const result = path.split('.').reduce((o, i) => o?.[i] as Record, obj)\n return result === undefined ? defaultValue! : (result as T)\n}\n"],"names":["getObjectDotNotation","obj","path","defaultValue","result","split","reduce","o","i","undefined"],"mappings":"AAAA;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMA,uBAAuB,CAClCC,KACAC,MACAC;IAEA,IAAI,CAACD,QAAQ,CAACD,KAAK;QACjB,OAAOE;IACT;IACA,MAAMC,SAASF,KAAKG,KAAK,CAAC,KAAKC,MAAM,CAAC,CAACC,GAAGC,IAAMD,GAAG,CAACC,EAAE,EAA6BP;IACnF,OAAOG,WAAWK,YAAYN,eAAiBC;AACjD,EAAC"}