(path, defaultValue)
| 528 | }, |
| 529 | |
| 530 | config(path, defaultValue) { |
| 531 | let obj: Record<any, any> = resolvedConfig |
| 532 | |
| 533 | if (!path) return obj |
| 534 | |
| 535 | let keypath = toKeyPath(path) |
| 536 | |
| 537 | for (let i = 0; i < keypath.length; ++i) { |
| 538 | let key = keypath[i] |
| 539 | |
| 540 | if (obj[key] === undefined) return defaultValue |
| 541 | |
| 542 | obj = obj[key] |
| 543 | } |
| 544 | |
| 545 | return obj ?? defaultValue |
| 546 | }, |
| 547 | } |
| 548 | |
| 549 | // Bind these functions so they can use `this` |