ctx-core 6.5.0 → 6.5.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/all/html_class/index.js +4 -6
- package/package.json +10 -3
package/all/html_class/index.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
/// <reference types="../attr/index.d.ts" />
|
|
2
|
-
import { isArray } from '../isArray/index.js'
|
|
3
1
|
/**
|
|
4
2
|
* Returns class html attribute from r
|
|
5
3
|
* @param {attr_def_T}class_def_a
|
|
6
4
|
* @returns {string}
|
|
7
5
|
* @example
|
|
8
6
|
* class_({class_1: true, html_class__: false, class_3: true}) // returns 'class_1 class_3'
|
|
7
|
+
* @see https://github.com/lukeed/clsx
|
|
9
8
|
*/
|
|
10
9
|
export function html_class_(...class_def_a) {
|
|
11
|
-
|
|
12
|
-
for (let
|
|
13
|
-
const class_def = class_def_a[i]
|
|
10
|
+
let a = []
|
|
11
|
+
for (let class_def of class_def_a) {
|
|
14
12
|
if (typeof class_def === 'string') {
|
|
15
13
|
a.push(class_def)
|
|
16
|
-
} else if (isArray(class_def)) {
|
|
14
|
+
} else if (Array.isArray(class_def)) {
|
|
17
15
|
a.push(...class_def)
|
|
18
16
|
} else if (typeof class_def === 'object') {
|
|
19
17
|
for (let key in class_def) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctx-core",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.2",
|
|
4
4
|
"description": "ctx-core core library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -300,12 +300,12 @@
|
|
|
300
300
|
"@ctx-core/preprocess": "^0.1.2",
|
|
301
301
|
"@size-limit/preset-small-lib": "^11.0.2",
|
|
302
302
|
"@types/jsdom": "^21.1.6",
|
|
303
|
-
"@types/node": "^20.11.
|
|
303
|
+
"@types/node": "^20.11.24",
|
|
304
304
|
"@types/sinon": "^17.0.3",
|
|
305
305
|
"c8": "^9.1.0",
|
|
306
306
|
"check-dts": "^0.7.2",
|
|
307
307
|
"esbuild": "^0.20.1",
|
|
308
|
-
"esmock": "^2.6.
|
|
308
|
+
"esmock": "^2.6.4",
|
|
309
309
|
"jsdom": "^24.0.0",
|
|
310
310
|
"sinon": "^17.0.1",
|
|
311
311
|
"size-limit": "^11.0.2",
|
|
@@ -388,6 +388,13 @@
|
|
|
388
388
|
},
|
|
389
389
|
"limit": "589 B"
|
|
390
390
|
},
|
|
391
|
+
{
|
|
392
|
+
"name": "class_",
|
|
393
|
+
"import": {
|
|
394
|
+
"./html": "{ class_ }"
|
|
395
|
+
},
|
|
396
|
+
"limit": "101 B"
|
|
397
|
+
},
|
|
391
398
|
{
|
|
392
399
|
"name": "uuid_",
|
|
393
400
|
"import": {
|