@dnd-kit/state 0.0.1 → 0.0.2-beta-20240610193339

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.js CHANGED
@@ -56,11 +56,19 @@ function deepEqual(a, b) {
56
56
  if (a === b) {
57
57
  return true;
58
58
  }
59
- if (Array.isArray(a)) {
60
- if (!Array.isArray(b)) {
59
+ if (a instanceof Set && b instanceof Set) {
60
+ if (a.size !== b.size) {
61
61
  return false;
62
62
  }
63
- if (a.length !== b.length) {
63
+ for (const value of a) {
64
+ if (!b.has(value)) {
65
+ return false;
66
+ }
67
+ }
68
+ return true;
69
+ }
70
+ if (Array.isArray(a)) {
71
+ if (!Array.isArray(b) || a.length !== b.length) {
64
72
  return false;
65
73
  }
66
74
  const hasDifferentValues = a.some(
package/dist/index.mjs CHANGED
@@ -31,11 +31,19 @@ function deepEqual(a, b) {
31
31
  if (a === b) {
32
32
  return true;
33
33
  }
34
- if (Array.isArray(a)) {
35
- if (!Array.isArray(b)) {
34
+ if (a instanceof Set && b instanceof Set) {
35
+ if (a.size !== b.size) {
36
36
  return false;
37
37
  }
38
- if (a.length !== b.length) {
38
+ for (const value of a) {
39
+ if (!b.has(value)) {
40
+ return false;
41
+ }
42
+ }
43
+ return true;
44
+ }
45
+ if (Array.isArray(a)) {
46
+ if (!Array.isArray(b) || a.length !== b.length) {
39
47
  return false;
40
48
  }
41
49
  const hasDifferentValues = a.some(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnd-kit/state",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-beta-20240610193339",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",