mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
chore: Add a with value
This commit is contained in:
@@ -5,6 +5,11 @@ export class Config<A> extends IBuilder<A> {
|
|||||||
static empty() {
|
static empty() {
|
||||||
return new Config({});
|
return new Config({});
|
||||||
}
|
}
|
||||||
|
static withValue<K extends string, B>(key: K, value: Value<B>) {
|
||||||
|
return new Config({
|
||||||
|
[key]: value.build(),
|
||||||
|
} as { [key in K]: B });
|
||||||
|
}
|
||||||
|
|
||||||
static of<B extends { [key: string]: Value<unknown> }>(spec: B) {
|
static of<B extends { [key: string]: Value<unknown> }>(spec: B) {
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
|
|||||||
Reference in New Issue
Block a user