lukeed/clsxPublic

A tiny (239B) utility for constructing `className` strings conditionally.

fix: enforce stricter type for lite #110

Openocavuewants to merge 0 commits intomasterfromrefs/pull/110/head
  1. OC

    Any non-string values passed to `clsx/lite` are intentionally ignored, thus passing arrays or objects to it is likely an error.

    > ```ts > // NOTE: Any non-string input(s) ignored > clsx({ foo: true }); > ```

    Currently, `clsx` and `clsx/lite` use the same type declaration, resulting in these user errors not being identified by type checking.

    This pull request introduces a new type declaration for `clsx/lite`. In comparison to the previous declaration, the follow argument types are still accectped:

    - `string | boolean | undefined | null`

    and the following types are not accepted anymore:

    - `ClassArray | ClassDictionary | number | bigint`

    This should help catch user errors.

  2. Unknown GitHub usercommitted 200d1165abbclast year on GitHub