{"version":3,"file":"replaceError.mjs","names":[],"sources":["../../src/logger/replaceError.ts"],"sourcesContent":["/*\n * The replacer parameter allows you to specify a function that replaces values with your own. We can use it to control what gets stringified.\n */\nexport function replaceError(_: unknown, value: unknown) {\n  /**\n   * This special handling for error classes is mostly to not hide error messages in React Native.\n   * The error serialization works differently from node, so a lot of times you get `error: {}`, which\n   * really compliactes debugging.\n   */\n  if (value instanceof Error) {\n    return {\n      serialized: 'toJSON' in value && typeof value.toJSON === 'function' ? value.toJSON() : value.toString(),\n      message: value.message,\n      name: value.name,\n      stack: value.stack,\n    }\n  }\n\n  return value\n}\n"],"mappings":";;;AAGA,SAAgB,aAAa,GAAY,OAAgB;;;;;;AAMvD,KAAI,iBAAiB,MACnB,QAAO;EACL,YAAY,YAAY,SAAS,OAAO,MAAM,WAAW,aAAa,MAAM,QAAQ,GAAG,MAAM,UAAU;EACvG,SAAS,MAAM;EACf,MAAM,MAAM;EACZ,OAAO,MAAM;EACd;AAGH,QAAO"}