its config, with defaults and global config applied
()
| 424 | |
| 425 | /** its config, with defaults and global config applied */ |
| 426 | get cfg(): ResolvedScopeConfig { |
| 427 | // the first read fixes the global config, so configure throws after it |
| 428 | const globalConfig = ($ark.cfg ??= resolveGlobalConfig($ark.defaultConfig)) |
| 429 | const cfg = mergeConfigs(globalConfig, this.scopeConfig) |
| 430 | const missing: InstalledOption | undefined = |
| 431 | cfg.errors !== "all" && !$ark.errorModes ? "errors" |
| 432 | : cfg.mutatesInput && !$ark.inPlace ? "mutatesInput" |
| 433 | : undefined |
| 434 | if (missing) { |
| 435 | throwParseError( |
| 436 | writeMissingImportMessage(missing, printable(cfg[missing])) |
| 437 | ) |
| 438 | } |
| 439 | // locale is global-only, though an untyped config can pass one |
| 440 | if (cfg.locale !== globalConfig.locale) |
| 441 | (cfg as { locale: Locale.Resolved }).locale = globalConfig.locale |
| 442 | return this.memo("cfg", cfg) |
| 443 | } |
| 444 | |
| 445 | get intrinsic(): Omit<typeof $ark.kw, `json${string}`> { |
| 446 | // intrinsic won't be available during bootstrapping, so we lie |
nothing calls this directly
no test coverage detected