(v: unknown)
| 34 | * ``` |
| 35 | */ |
| 36 | export function format(v: unknown): string { |
| 37 | // deno-lint-ignore no-explicit-any |
| 38 | const { Deno, process } = globalThis as any; |
| 39 | |
| 40 | const inspect: InspectFn | undefined = Deno?.inspect ?? |
| 41 | process?.getBuiltinModule?.("node:util")?.inspect; |
| 42 | |
| 43 | return typeof inspect === "function" |
| 44 | ? inspect(v, { |
| 45 | depth: Infinity, |
| 46 | sorted: true, |
| 47 | trailingComma: true, |
| 48 | compact: false, |
| 49 | iterableLimit: Infinity, |
| 50 | // getters should be true in assertEquals. |
| 51 | getters: true, |
| 52 | strAbbreviateSize: Infinity, |
| 53 | }) |
| 54 | : basicInspect(v); |
| 55 | } |
| 56 | |
| 57 | const formatters: ((v: unknown) => string | undefined)[] = [ |
| 58 | (v) => { |
no test coverage detected