From 087b112c71ce942a1b39b5ad9ee3f3670516520f Mon Sep 17 00:00:00 2001 From: Ricardo Vela Date: Thu, 10 Oct 2024 12:24:22 -0600 Subject: [PATCH] Revert "type VaryOptions.defaultVariant as a string" 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. --- src/visitor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visitor.ts b/src/visitor.ts index 91cf3d8..a125fad 100644 --- a/src/visitor.ts +++ b/src/visitor.ts @@ -16,7 +16,7 @@ type Variants = { export type VaryOptions = { variants: Variants; context: string; - defaultVariant: string; + defaultVariant: boolean | string; }; export type AbOptions = { @@ -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); }