@parcel/graph 2.9.4-nightly.3014 → 2.9.4-nightly.3022
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/lib/BitSet.js +8 -0
- package/package.json +2 -3
- package/src/BitSet.js +10 -0
- package/test/BitSet.test.js +12 -0
package/lib/BitSet.js
CHANGED
@@ -38,6 +38,14 @@ class BitSet {
|
|
38
38
|
has(bit) {
|
39
39
|
return Boolean(this.bits[bit >>> 5] & 1 << (bit & 31));
|
40
40
|
}
|
41
|
+
empty() {
|
42
|
+
for (let k = 0; k < this.bits.length; k++) {
|
43
|
+
if (this.bits[k] !== 0) {
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
return true;
|
48
|
+
}
|
41
49
|
clear() {
|
42
50
|
this.bits.fill(0);
|
43
51
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parcel/graph",
|
3
|
-
"version": "2.9.4-nightly.
|
3
|
+
"version": "2.9.4-nightly.3022+5d875a272",
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
5
5
|
"license": "MIT",
|
6
6
|
"publishConfig": {
|
@@ -20,8 +20,7 @@
|
|
20
20
|
"node": ">= 12.0.0"
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
|
-
"@parcel/utils": "2.0.0-nightly.1391+ddd838171",
|
24
23
|
"nullthrows": "^1.1.1"
|
25
24
|
},
|
26
|
-
"gitHead": "
|
25
|
+
"gitHead": "5d875a2720e1fd3636ff107b1dec2254d32d25b9"
|
27
26
|
}
|
package/src/BitSet.js
CHANGED
@@ -55,6 +55,16 @@ export class BitSet {
|
|
55
55
|
return Boolean(this.bits[i] & (1 << b));
|
56
56
|
}
|
57
57
|
|
58
|
+
empty(): boolean {
|
59
|
+
for (let k = 0; k < this.bits.length; k++) {
|
60
|
+
if (this.bits[k] !== 0) {
|
61
|
+
return false;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
return true;
|
66
|
+
}
|
67
|
+
|
58
68
|
clear() {
|
59
69
|
this.bits.fill(0);
|
60
70
|
}
|
package/test/BitSet.test.js
CHANGED
@@ -55,6 +55,18 @@ describe('BitSet', () => {
|
|
55
55
|
assertValues(set1, [1, 5]);
|
56
56
|
});
|
57
57
|
|
58
|
+
it('empty should check if there are no values set', () => {
|
59
|
+
let set1 = new BitSet(5);
|
60
|
+
|
61
|
+
assert(set1.empty());
|
62
|
+
|
63
|
+
set1.add(3);
|
64
|
+
assert(!set1.empty());
|
65
|
+
|
66
|
+
set1.delete(3);
|
67
|
+
assert(set1.empty());
|
68
|
+
});
|
69
|
+
|
58
70
|
it('should intersect with another BitSet', () => {
|
59
71
|
let set1 = new BitSet(5);
|
60
72
|
set1.add(1);
|