(path: string[], value: string | number | boolean | KeyValue)
| 459 | } |
| 460 | |
| 461 | export function set(path: string[], value: string | number | boolean | KeyValue): void { |
| 462 | // biome-ignore lint/suspicious/noExplicitAny: auto-parsing |
| 463 | let settings: any = getPersistedSettings(); |
| 464 | |
| 465 | for (let i = 0; i < path.length; i++) { |
| 466 | const key = path[i]; |
| 467 | if (i === path.length - 1) { |
| 468 | settings[key] = value; |
| 469 | } else { |
| 470 | if (!settings[key]) { |
| 471 | settings[key] = {}; |
| 472 | } |
| 473 | |
| 474 | settings = settings[key]; |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | write(); |
| 479 | } |
| 480 | |
| 481 | export function apply(settings: Record<string, unknown>, throwOnError = true): boolean { |
| 482 | getPersistedSettings(); // Ensure _settings is initialized. |
nothing calls this directly
no test coverage detected