klsx 0.4.0 → 0.4.1
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 +7 -4
- package/dist/index.js +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# 🎨 𝒌𝒍𝒔𝒙
|
|
2
2
|
|
|
3
|
-
The fastest classname constructor out there, drop-in replacement for [clsx](https://www.npmjs.com/package/clsx)
|
|
3
|
+
#### The fastest classname constructor out there, drop-in replacement for [clsx](https://www.npmjs.com/package/clsx)
|
|
4
|
+
|
|
5
|
+
---
|
|
4
6
|
|
|
5
7
|
Conditionally joins class names together from strings, arrays and key-value objects:
|
|
6
8
|
|
|
@@ -16,14 +18,15 @@ klsx({ foo: 'string', bar: true, bux: null }, 'baz') // => "foo bar baz"
|
|
|
16
18
|
|
|
17
19
|
- 🚀 Faster than [clsx](https://www.npmjs.com/package/clsx), [classnames](https://www.npmjs.com/package/classnames) and even [classix](https://www.npmjs.com/package/classix)
|
|
18
20
|
- 🎯 Same of full featured [clsx](https://www.npmjs.com/package/clsx), just change a `c` with `k` and you've done!
|
|
19
|
-
- 👑 ES Module syntax, written in TypeScript and
|
|
21
|
+
- 👑 ES Module syntax, written in TypeScript and tested on [Bun](https://bun.com)
|
|
20
22
|
- 💎 Zero dependencies, less than 200 bytes (Brotli)
|
|
21
23
|
- 🐳 Provided with [real-world usage benchmark and memory footprint analysis](https://github.com/vuolter/klsx/blob/main/BENCHMARK.md)
|
|
22
|
-
- 🚨 [Experimental WASM variant](https://github.com/vuolter/klsx/tree/wasm) (research purpose only)
|
|
23
24
|
|
|
24
25
|
## Benchmark
|
|
25
26
|
|
|
26
|
-
Throughput (ops/s, higher is better) from the latest run
|
|
27
|
+
Throughput (ops/s, higher is better) from the latest run:
|
|
28
|
+
|
|
29
|
+
###### Bars are scaled to the fastest package in each test
|
|
27
30
|
|
|
28
31
|

|
|
29
32
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(t,n){for(let r=0;r<n.length;r++){let i=n[r];if(i){if(typeof i==`string`)t=t?t+` `+i:i;else if(Array.isArray(i))t=e(t,i);else if(typeof i==`object`)for(let e in i)e&&i[e]&&(t=t?t+` `+e:e)}}return t}function t(){let t=``;for(let n=0;n<arguments.length;n++){let r=arguments[n];if(r){if(typeof r==`string`)t=t?t+` `+r:r;else if(Array.isArray(r))t=e(t,r);else if(typeof r==`object`)for(let e in r)e&&r[e]&&(t=t?t+` `+e:e)}}return t}export{t as default,t as klsx,t as kx};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "klsx",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "The fastest classname constructor out there, drop-in replacement for clsx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
7
7
|
"class",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"cn",
|
|
13
13
|
"cx",
|
|
14
14
|
"klsx",
|
|
15
|
-
"kx"
|
|
15
|
+
"kx",
|
|
16
|
+
"react",
|
|
17
|
+
"tailwind-merge"
|
|
16
18
|
],
|
|
17
19
|
"license": "MIT",
|
|
18
20
|
"author": {
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@socketsecurity/bun-security-scanner": "1.1.3",
|
|
46
48
|
"@types/bun": "1.4.4",
|
|
47
|
-
"classix": "2.2.
|
|
49
|
+
"classix": "2.2.27",
|
|
48
50
|
"classnames": "2.5.1",
|
|
49
51
|
"clsx": "2.1.1",
|
|
50
52
|
"oxfmt": "0.76.0",
|