simple-merge-class-names 5.0.7 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -32
- package/mergeClassNames.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,10 +141,6 @@ mergeClassNames: (...args: (string | false)[]) => string;
|
|
|
141
141
|
mergeClassNamesDebugger: (...args: (string | false)[]) => string;
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
```jsx
|
|
145
|
-
isEmptyString: (argument: string) => boolean;
|
|
146
|
-
```
|
|
147
|
-
|
|
148
144
|
For both `mergeClassNames` and `mergeClassNamesDebugger` they always return a string.
|
|
149
145
|
|
|
150
146
|
- If no inputs were provided e.g. `mergeClassNames()` or were invalid `mergeClassNames(undefined, " ")` then an _empty string_ is returned `""`
|
|
@@ -283,34 +279,6 @@ const MyComponent = () => {
|
|
|
283
279
|
};
|
|
284
280
|
```
|
|
285
281
|
|
|
286
|
-
- If chaining the result of another `mergeClassNames` then use `isEmptyString` to check if the result is not the _empty string_ (`""`):
|
|
287
|
-
|
|
288
|
-
```jsx
|
|
289
|
-
import { mergeClassNames, isEmptyString } from "simple-merge-class-names";
|
|
290
|
-
|
|
291
|
-
const MyComponent = ({ condition, resultOfAnotherMergeClassNames }) => {
|
|
292
|
-
return (
|
|
293
|
-
<div
|
|
294
|
-
className={mergeClassNames(
|
|
295
|
-
"app",
|
|
296
|
-
|
|
297
|
-
condition ? "min-h-dvh" : false,
|
|
298
|
-
|
|
299
|
-
isEmptyString(resultOfAnotherMergeClassNames)
|
|
300
|
-
? false
|
|
301
|
-
: resultOfAnotherMergeClassNames,
|
|
302
|
-
|
|
303
|
-
"grid",
|
|
304
|
-
"grid-rows-[auto_1fr_auto]",
|
|
305
|
-
"outline"
|
|
306
|
-
)}
|
|
307
|
-
>
|
|
308
|
-
Hello, world!
|
|
309
|
-
</div>
|
|
310
|
-
);
|
|
311
|
-
};
|
|
312
|
-
```
|
|
313
|
-
|
|
314
282
|
## Testing
|
|
315
283
|
|
|
316
284
|
This project uses `Vitest` as the test runner for fast and modern testing.
|
package/mergeClassNames.js
CHANGED