mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-31 04:33:40 +00:00
chore: Let the config use the withValue as an alias
This commit is contained in:
@@ -21,6 +21,12 @@ export class Config<A extends ConfigSpec> extends IBuilder<A> {
|
|||||||
}
|
}
|
||||||
return new Config(answer);
|
return new Config(answer);
|
||||||
}
|
}
|
||||||
|
withValue<K extends string, B extends ValueSpecAny>(key: K, value: Value<B>) {
|
||||||
|
return new Config({
|
||||||
|
...this.a,
|
||||||
|
[key]: value.build(),
|
||||||
|
} as A & { [key in K]: B });
|
||||||
|
}
|
||||||
addValue<K extends string, B extends ValueSpecAny>(key: K, value: Value<B>) {
|
addValue<K extends string, B extends ValueSpecAny>(key: K, value: Value<B>) {
|
||||||
return new Config({
|
return new Config({
|
||||||
...this.a,
|
...this.a,
|
||||||
|
|||||||
Reference in New Issue
Block a user