{"version":3,"file":"has.cjs","names":[],"sources":["../../src/object/has.ts"],"sourcesContent":["/**\n * Checks if path is a direct or inherited property of object\n * @param obj - The object to query\n * @param path - The path to check (can be string or array)\n * @returns Returns true if path exists, else false\n * @example\n * const obj = { a: { b: { c: 3 } } };\n * has(obj, 'a.b.c'); // true\n * has(obj, ['a', 'b', 'c']); // true\n * has(obj, 'a.b.d'); // false\n */\nexport function has(obj: unknown, path: string | readonly (string | number)[]): boolean {\n  if (obj == null) {\n    return false;\n  }\n\n  // Convert string path to array\n  const pathArray: (string | number)[] =\n    typeof path === 'string'\n      ? path\n          .replace(/\\[(\\d+)\\]/g, '.$1')\n          .split('.')\n          .filter(Boolean)\n      : [...path];\n\n  let current: unknown = obj;\n\n  for (const key of pathArray) {\n    if (current == null || (typeof current !== 'object' && typeof current !== 'function')) {\n      return false;\n    }\n    if (!(key in Object(current))) {\n      return false;\n    }\n    current = (current as Record<PropertyKey, unknown>)[key];\n  }\n\n  return true;\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,IAAI,KAAc,MAAsD;CACtF,IAAI,OAAO,MACT,OAAO;CAIT,MAAM,YACJ,OAAO,SAAS,WACZ,KACG,QAAQ,cAAc,KAAK,CAAC,CAC5B,MAAM,GAAG,CAAC,CACV,OAAO,OAAO,IACjB,CAAC,GAAG,IAAI;CAEd,IAAI,UAAmB;CAEvB,KAAK,MAAM,OAAO,WAAW;EAC3B,IAAI,WAAW,QAAS,OAAO,YAAY,YAAY,OAAO,YAAY,YACxE,OAAO;EAET,IAAI,EAAE,OAAO,OAAO,OAAO,IACzB,OAAO;EAET,UAAW,QAAyC;CACtD;CAEA,OAAO;AACT"}