@cuemath/web-utils 0.0.1-beta.2 → 0.0.1-beta.4

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.
@@ -0,0 +1,26 @@
1
+ export function isEmpty(obj: object): boolean {
2
+ return Object.keys(obj).length === 0;
3
+ }
4
+
5
+ // In this case both object have same key names Don't use to compare objects
6
+ export function isMapEqual(
7
+ map1: { [x: string]: any },
8
+ map2: { [x: string]: any },
9
+ ): boolean {
10
+ const map1Keys = Object.keys(map1);
11
+ const map2Keys = Object.keys(map2);
12
+
13
+ if (map1Keys.length !== map2Keys.length) {
14
+ return false;
15
+ }
16
+ for (let i = 0; i < map1Keys.length; i += 1) {
17
+ const key = map1Keys[i];
18
+
19
+ if (map1[key] !== map2[key]) {
20
+ return false;
21
+ }
22
+ }
23
+
24
+ return true;
25
+ }
26
+
package/lerna.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "packages": [
3
- "packages/*"
4
- ],
5
- "version": "independent",
6
- "npmClient": "yarn",
7
- "useWorkspaces": true
8
- }