@gasket/utils
Advanced tools
Comparing version 7.2.1 to 7.2.2
@@ -10,10 +10,14 @@ // This file is exported by the package and can be imported directly. | ||
interface ConfigDefinition extends Record<string, any> { | ||
environments?: Record<string, Partial<ConfigDefinition>>; | ||
commands?: Record<string, Partial<ConfigDefinition>>; | ||
[key: string]: any; | ||
// TODO: switch @gasket/core to re-exporting this type once this change is | ||
// published and we can update its dependency to this version | ||
export type PartialRecursive<T> = T extends Object | ||
? { [K in keyof T]?: PartialRecursive<T[K]> } | undefined | ||
: T | undefined; | ||
type ConfigDefinition<T> = T & { | ||
environments?: Record<string, PartialRecursive<T>>; | ||
commands?: Record<string, PartialRecursive<T>>; | ||
} | ||
type ConfigOutput = Omit<ConfigDefinition, 'environments' | 'commands'>; | ||
type ConfigPartial = Partial<ConfigDefinition> | undefined | void | unknown; | ||
type ConfigPartial<T extends ConfigDefinition> = PartialRecursive<T> | undefined | void | unknown; | ||
@@ -26,3 +30,3 @@ export function getPotentialConfigs( | ||
export function getCommandOverrides( | ||
commands: Record<string, Partial<ConfigDefinition>>, | ||
commands: Record<string, PartialRecursive<ConfigDefinition>>, | ||
commandId: string | ||
@@ -33,3 +37,3 @@ ): Array<ConfigPartial>; | ||
env: string, | ||
environments: Record<string, Partial<ConfigDefinition>> | ||
environments: Record<string, PartialRecursive<ConfigDefinition>> | ||
): Array<ConfigPartial>; | ||
@@ -39,3 +43,3 @@ | ||
isLocalEnv: boolean, | ||
environments: Record<string, Partial<ConfigDefinition>> | ||
environments: Record<string, PartialRecursive<ConfigDefinition>> | ||
): Array<ConfigPartial>; | ||
@@ -58,5 +62,5 @@ | ||
// local-only config file. | ||
export function applyConfigOverrides< | ||
Def extends ConfigDefinition, | ||
Out extends ConfigOutput | ||
>(config: Def, configContext: ConfigContext): Out; | ||
export function applyConfigOverrides<Config>( | ||
config: ConfigDefinition<Config>, | ||
configContext: ConfigContext | ||
): Config; |
{ | ||
"name": "@gasket/utils", | ||
"version": "7.2.1", | ||
"version": "7.2.2", | ||
"description": "Reusable utilities for Gasket internals", | ||
@@ -55,3 +55,3 @@ "files": [ | ||
"devDependencies": { | ||
"@gasket/core": "^7.2.1", | ||
"@gasket/core": "^7.2.2", | ||
"@types/concat-stream": "^2.0.3", | ||
@@ -113,3 +113,3 @@ "@types/cross-spawn": "^6.0.6", | ||
], | ||
"gitHead": "8af41663d838cb00344ffbdabf64fc535b78dd3d" | ||
"gitHead": "f34775900acd2c6a6b3a224751c6dc091b7f50fe" | ||
} |
24229
593