Skip to content

Commit

Permalink
Revert "type VaryOptions.defaultVariant as a string"
Browse files Browse the repository at this point in the history
This broke tests. Still think this could be changed, but I want to
minimize the surface area of changes to expedite the fixes over at retail.
  • Loading branch information
argvniyx-enroute committed Oct 10, 2024
1 parent 5cd5d8d commit 087b112
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Variants = {
export type VaryOptions = {
variants: Variants;
context: string;
defaultVariant: string;
defaultVariant: boolean | string;
};

export type AbOptions = {
Expand Down Expand Up @@ -124,7 +124,7 @@ class Visitor {
throw new Error('must provide variants object to `vary` for ' + splitName);
} else if (!options.context) {
throw new Error('must provide context to `vary` for ' + splitName);
} else if (!options.defaultVariant) {
} else if (!options.defaultVariant && options.defaultVariant !== false) {
throw new Error('must provide defaultVariant to `vary` for ' + splitName);
}

Expand Down

0 comments on commit 087b112

Please sign in to comment.