variant-classnames
variant-classnames copied to clipboard
$notnil selector doesn't work
Hey,
The $notnil selector doesn't work, and I know why. In your code you have:
// when prop has no value, we pretent value is $nil to be able to kick off $nil hook later.
if (isNil(correspondingSourceValue)) {
correspondingSourceValue = $nil;
}
// ...
if (!isNil(valueVariations[$notnil]) && !isNil(correspondingSourceValue)) {
matchingVariations = [valueVariations[$notnil], matchingVariations].filter(Boolean).join(" ");
}
Because you set correspondingSourceValue
to $nil
, the check !isNil(correspondingSourceValue)
does not become true. Instead, you can check with !isNil(source[prop])