klsx 0.4.0 → 0.4.2

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 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,16 +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 optimized for [Bun](https://bun.com)
21
+ - 👑 ES Module syntax, written in TypeScript and tested on [Bun](https://bun.com)
20
22
  - 💎 Zero dependencies, less than 200 bytes (Brotli)
21
- - 🐳 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
+ - 📈 Provided with [real-world usage benchmark and memory footprint analysis](https://github.com/vuolter/klsx/blob/main/BENCHMARK.md)
23
24
 
24
25
  ## Benchmark
25
26
 
26
- Throughput (ops/s, higher is better) from the latest run. Bars are scaled to the fastest package in each test:
27
+ Throughput (ops/s, higher is better) from the latest run:
27
28
 
28
- ![Throughput benchmark: 𝒌𝒍𝒔𝒙 vs clsx, classnames and classix](benchmark.svg)
29
+ ![Throughput benchmark: 𝒌𝒍𝒔𝒙 vs clsx, classnames and classix](assets/benchmark.svg)
29
30
 
30
31
  Full results: [BENCHMARK.md](BENCHMARK.md).
31
32
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- const e=Array.isArray;function t(e,t){for(let n in e)n&&e[n]&&(t=t?t+` `+n:n);return t}function n(r,i){for(let a=0;a<r.length;a++){let o=r[a];o&&(typeof o==`string`?i=i?i+` `+o:o:typeof o==`object`&&(i=e(o)?n(o,i):t(o,i)))}return i}function r(...r){let i=``;for(let a=0;a<r.length;a++){let o=r[a];o&&(typeof o==`string`?i=i?i+` `+o:o:typeof o==`object`&&(i=e(o)?n(o,i):t(o,i)))}return i}export{r as default,r as klsx,r as kx};
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.0",
4
- "description": "Same as clsx but \"maybe\" better",
3
+ "version": "0.4.2",
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,14 +46,14 @@
44
46
  "devDependencies": {
45
47
  "@socketsecurity/bun-security-scanner": "1.1.3",
46
48
  "@types/bun": "1.4.4",
47
- "classix": "2.2.21",
49
+ "classix": "2.2.27",
48
50
  "classnames": "2.5.1",
49
51
  "clsx": "2.1.1",
50
52
  "oxfmt": "0.76.0",
51
53
  "oxlint": "1.91.0",
52
- "oxlint-tsgolint": "7.0.2005",
54
+ "oxlint-tsgolint": "7.0.2006",
53
55
  "tinybench": "6.2.3",
54
- "tsdown": "0.23.4",
56
+ "tsdown": "0.23.5",
55
57
  "typescript": "7.0.2"
56
58
  },
57
59
  "engines": {