Try to load failed config if normal config is unavailable

Adapt relevant functions by narrowing their types or skipping steps that would otherwise have been skipped as well
This commit is contained in:
Michael B. Gale
2026-10-12 11:25:00 +01:00
parent 4fdbb71b54
commit f4a15a13fd
8 changed files with 92 additions and 29 deletions

View File

@@ -143,6 +143,14 @@ export type ActionConfig<
T extends ActionConfigProperties = ActionConfigProperties,
> = Partial<Config> & Pick<Config, T>;
/** Helper function to check whether `config` has `key` to narrow the type of `config`. */
export function hasConfigKey<Key extends ActionConfigProperties>(
config: Partial<Config>,
key: Key,
): config is ActionConfig<Key> {
return config[key] !== undefined;
}
/** A minimal configuration that we can make available even when `init` aborts. */
export type AbortedInitConfig = ActionConfig<
| "version"