{
  "version": 3,
  "sources": ["../../src/jsutils/getObjectAtPath.ts"],
  "sourcesContent": ["import type { ObjMap } from \"./ObjMap\";\n\n/**\n * Walks `result` following `path` and returns the nested value, but only when\n * that value is a non-null object (a valid `Object.assign` target). Returns\n * `undefined` if any segment is missing or the resolved value is not an object.\n */\nexport function getObjectAtPath(\n  result: ObjMap<unknown>,\n  path: ReadonlyArray<string | number>,\n): ObjMap<unknown> | undefined {\n  let target = result;\n  for (const key of path) {\n    const next = target[key];\n    if (next === null || typeof next !== \"object\") {\n      return undefined;\n    }\n    target = next as ObjMap<unknown>;\n  }\n\n  return target;\n}\n"],
  "mappings": ";AAOO,SAAS,gBACd,QACA,MAC6B;AAC7B,MAAI,SAAS;AACb,aAAW,OAAO,MAAM;AACtB,UAAM,OAAO,OAAO,GAAG;AACvB,QAAI,SAAS,QAAQ,OAAO,SAAS,UAAU;AAC7C,aAAO;AAAA,IACT;AACA,aAAS;AAAA,EACX;AAEA,SAAO;AACT;",
  "names": []
}
