mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-31 20:43:43 +00:00
29 lines
792 B
JavaScript
29 lines
792 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Variants = void 0;
|
|
const builder_js_1 = require("./builder.js");
|
|
class Variants extends builder_js_1.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(),
|
|
});
|
|
}
|
|
}
|
|
exports.Variants = Variants;
|