(obj: unknown)
| 465 | } |
| 466 | |
| 467 | export function bigIntToString(obj: unknown): unknown { |
| 468 | if (obj === null) { |
| 469 | return obj; |
| 470 | } |
| 471 | |
| 472 | if (typeof obj === 'bigint') { |
| 473 | return obj.toString(); |
| 474 | } |
| 475 | |
| 476 | if (Array.isArray(obj)) { |
| 477 | return obj.map((item) => bigIntToString(item)); |
| 478 | } |
| 479 | |
| 480 | if (typeof obj === 'object') { |
| 481 | const result: { [key: string]: unknown } = {}; |
| 482 | for (const key in obj) { |
| 483 | if (Object.prototype.hasOwnProperty.call(obj, key)) { |
| 484 | result[key] = bigIntToString((obj as Record<string, unknown>)[key]); |
| 485 | } |
| 486 | } |
| 487 | return result; |
| 488 | } |
| 489 | |
| 490 | return obj; |
| 491 | } |
| 492 | |
| 493 | function mapFunctionNames(toolNames: string[]) { |
| 494 | return toolNames?.map((t) => tools[t]); |
no outgoing calls
no test coverage detected