mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: Update deps
This commit is contained in:
24
lib/esm/config/variants.js
Normal file
24
lib/esm/config/variants.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { IBuilder } from "./builder.js";
|
||||
export class Variants extends IBuilder {
|
||||
static of(a) {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const variants = {};
|
||||
for (const key in a) {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
variants[key] = a[key].build();
|
||||
}
|
||||
return new Variants(variants);
|
||||
}
|
||||
static empty() {
|
||||
return Variants.of({});
|
||||
}
|
||||
static withVariant(key, value) {
|
||||
return Variants.empty().withVariant(key, value);
|
||||
}
|
||||
withVariant(key, value) {
|
||||
return new Variants({
|
||||
...this.a,
|
||||
[key]: value.build(),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user