@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
1 lines • 1.06 kB
Source Map (JSON)
{"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"}