(x: unknown)
| 193 | } |
| 194 | |
| 195 | export function toSafeString(x: unknown): string { |
| 196 | if (typeof x === 'undefined' || x === null) { |
| 197 | return ''; |
| 198 | } |
| 199 | if (typeof x === 'string') { |
| 200 | return x; |
| 201 | } |
| 202 | if (typeof x === 'boolean' || typeof x === 'number') { |
| 203 | return String(x); |
| 204 | } |
| 205 | return toJson(x); |
| 206 | } |
| 207 | |
| 208 | export function ObjToKv(obj: Record<string, unknown>): { key: string; value: unknown }[] { |
| 209 | const ar = [] as { key: string; value: unknown }[]; |
no test coverage detected
searching dependent graphs…