(v: unknown)
| 348 | */ |
| 349 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 350 | static toBool(v: unknown): boolean { |
| 351 | if (typeof v === 'boolean') { |
| 352 | return v; |
| 353 | } |
| 354 | if (typeof v === 'string') { |
| 355 | v = v.toLowerCase(); |
| 356 | return !(v === '' || v === 'no' || v === 'false' || v === '0'); |
| 357 | } |
| 358 | return Boolean(v); |
| 359 | } |
| 360 | |
| 361 | /** |
| 362 | * Convert a string value to a number, handling null and empty strings. |
no outgoing calls
no test coverage detected