@aiszlab/relax 1.0.26 → 1.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/dist/index.d.ts CHANGED
@@ -19,3 +19,5 @@ export { isUndefined } from './utils/is-undefined';
19
19
  export { isStateGetter } from './utils/is-state-getter';
20
20
  export { isNull } from './utils/is-null';
21
21
  export { isVoid } from './utils/is-void';
22
+ export { isArray } from './utils/is-array';
23
+ export { isEmpty } from './utils/is-empty';
package/dist/index.js CHANGED
@@ -11,3 +11,5 @@ export { isUndefined } from './utils/is-undefined.js';
11
11
  export { isStateGetter } from './utils/is-state-getter.js';
12
12
  export { isNull } from './utils/is-null.js';
13
13
  export { isVoid } from './utils/is-void.js';
14
+ export { isArray } from './utils/is-array.js';
15
+ export { isEmpty } from './utils/is-empty.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description
3
+ * is array
4
+ */
5
+ const isArray = (value) => {
6
+ return Array.isArray(value);
7
+ };
8
+
9
+ export { isArray };
@@ -0,0 +1,28 @@
1
+ import 'react';
2
+ import 'rxjs';
3
+ import 'react-is';
4
+ import { isVoid } from './is-void.js';
5
+ import { isArray } from './is-array.js';
6
+
7
+ /**
8
+ * @author murukal
9
+ *
10
+ * @description
11
+ * is empty
12
+ */
13
+ const isEmpty = (value) => {
14
+ // null or undefined
15
+ if (isVoid(value))
16
+ return true;
17
+ // object
18
+ if (typeof value === 'object') {
19
+ return Object.keys(value).length === 0;
20
+ }
21
+ // array
22
+ if (isArray(value)) {
23
+ return value.length === 0;
24
+ }
25
+ return !!value;
26
+ };
27
+
28
+ export { isEmpty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "react utils collection",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",