Created
July 11, 2021 17:08
-
-
Save 0az/8a795d87ecfbd9bad6b27ba47230b378 to your computer and use it in GitHub Desktop.
Single File replacement for the classnames package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MaybeClassName = string | boolean | null | undefined | MaybeClassName[] | |
export const kn = (...args: MaybeClassName[]): string => | |
args | |
.filter(e => e) | |
.flat() | |
// eslint-disable-next-line prefer-template | |
.map(e => e + '') | |
.join(' ') | |
export default kn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment