kitzo 2.0.26 → 2.0.27

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
@@ -25,7 +25,7 @@ npm i kitzo
25
25
  or
26
26
 
27
27
  ```javascript
28
- <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.26/dist/kitzo.umd.min.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.27/dist/kitzo.umd.min.js"></script>
29
29
  ```
30
30
 
31
31
  > Attach this script tag in the html head tag and you are good to go.
@@ -41,6 +41,7 @@ or
41
41
  | [`kitzo.ripple()`](#ripple-api) |
42
42
  | [`kitzo.debounce()`](#debounce-api) |
43
43
  | [`kitzo.clippath()`](#clippath-api) |
44
+ | [`kitzo.getType()`](#typecheck-api) |
44
45
 
45
46
  #### Vanilla APIs
46
47
 
@@ -53,6 +54,7 @@ kitzo.tooltip();
53
54
  kitzo.ripple();
54
55
  kitzo.debounce();
55
56
  kitzo.clippath();
57
+ kitzo.getType();
56
58
  ```
57
59
 
58
60
  > Use a modern build tool. **vite** - recommended
@@ -124,6 +126,14 @@ kitzo.clippath(selectors | element | NodeList, {
124
126
  style: object,
125
127
  });
126
128
  ```
129
+ ##### TypeCheck API:
130
+
131
+ ```javascript
132
+ kitzo.getType(type);
133
+
134
+ const data = [];
135
+ console.log(kitzo.getType(data)) // 'array'
136
+ ```
127
137
 
128
138
  ---
129
139
 
package/dist/kitzo.esm.js CHANGED
@@ -568,6 +568,22 @@ function clippath(element, config = {}) {
568
568
  }
569
569
  }
570
570
 
571
- const kitzo = { copy, debounce, ripple, tooltip, clippath };
571
+ function getType(value) {
572
+ if (value === null) return 'null';
573
+
574
+ if (Array.isArray(value)) return 'array';
575
+
576
+ if (value instanceof Date) return 'date';
577
+
578
+ if (value instanceof RegExp) return 'regexp';
579
+
580
+ if (typeof value === 'object') return 'object';
581
+
582
+ return typeof value;
583
+ }
584
+
585
+ // button effects
586
+
587
+ const kitzo = { copy, debounce, ripple, tooltip, clippath, getType };
572
588
 
573
- export { clippath, copy, debounce, kitzo as default, ripple, tooltip };
589
+ export { clippath, copy, debounce, kitzo as default, getType, ripple, tooltip };
package/dist/kitzo.umd.js CHANGED
@@ -574,7 +574,23 @@
574
574
  }
575
575
  }
576
576
 
577
- const kitzo = { copy, debounce, ripple, tooltip, clippath };
577
+ function getType(value) {
578
+ if (value === null) return 'null';
579
+
580
+ if (Array.isArray(value)) return 'array';
581
+
582
+ if (value instanceof Date) return 'date';
583
+
584
+ if (value instanceof RegExp) return 'regexp';
585
+
586
+ if (typeof value === 'object') return 'object';
587
+
588
+ return typeof value;
589
+ }
590
+
591
+ // button effects
592
+
593
+ const kitzo = { copy, debounce, ripple, tooltip, clippath, getType };
578
594
 
579
595
  return kitzo;
580
596
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "A lightweight JavaScript UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/kitzo.umd.js",