@parcel/utils 2.0.0-nightly.1380 → 2.0.0-nightly.1381
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/index.js +0 -92
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.js +0 -1
- package/src/BitSet.js +0 -126
- package/test/BitSet.test.js +0 -119
package/lib/index.js
CHANGED
|
@@ -3475,7 +3475,6 @@ $parcel$export(module.exports, "matchSourceMappingURL", () => $58ae611e06043814$
|
|
|
3475
3475
|
$parcel$export(module.exports, "loadSourceMapUrl", () => $58ae611e06043814$export$527a92fa675f5e93);
|
|
3476
3476
|
$parcel$export(module.exports, "loadSourceMap", () => $58ae611e06043814$export$c500fecaca54de65);
|
|
3477
3477
|
$parcel$export(module.exports, "remapSourceLocation", () => $58ae611e06043814$export$2fed780245c466c1);
|
|
3478
|
-
$parcel$export(module.exports, "BitSet", () => $0f54b57eb7ece508$export$33dc8f3f7b9e35df);
|
|
3479
3478
|
$parcel$export(module.exports, "stripAnsi", () => (/*@__PURE__*/$parcel$interopDefault($166044cf9ce846b7$exports)));
|
|
3480
3479
|
function $e7d0753bf78fdf0d$export$2e2bcd8739ae039(string, startIndex = 0) {
|
|
3481
3480
|
let lines = 1;
|
|
@@ -37540,97 +37539,6 @@ function $58ae611e06043814$export$2fed780245c466c1(loc, originalMap) {
|
|
|
37540
37539
|
}
|
|
37541
37540
|
|
|
37542
37541
|
|
|
37543
|
-
|
|
37544
|
-
// As our current version of flow doesn't support BigInt's, these values/types
|
|
37545
|
-
// have been hoisted to keep the flow errors to a minimum. This can be removed
|
|
37546
|
-
// if we upgrade to a flow version that supports BigInt's
|
|
37547
|
-
// $FlowFixMe
|
|
37548
|
-
// $FlowFixMe
|
|
37549
|
-
const $0f54b57eb7ece508$var$BIGINT_ZERO = 0n;
|
|
37550
|
-
// $FlowFixMe
|
|
37551
|
-
const $0f54b57eb7ece508$var$BIGINT_ONE = 1n;
|
|
37552
|
-
// $FlowFixMe
|
|
37553
|
-
let $0f54b57eb7ece508$var$numberToBigInt = (v)=>BigInt(v);
|
|
37554
|
-
let $0f54b57eb7ece508$var$bitUnion = (a, b)=>a | b;
|
|
37555
|
-
class $0f54b57eb7ece508$export$33dc8f3f7b9e35df {
|
|
37556
|
-
constructor({ initial: initial, items: items, lookup: lookup }){
|
|
37557
|
-
var _initial;
|
|
37558
|
-
if (initial instanceof $0f54b57eb7ece508$export$33dc8f3f7b9e35df) this._value = (_initial = initial) === null || _initial === void 0 ? void 0 : _initial._value;
|
|
37559
|
-
else if (initial) this._value = initial;
|
|
37560
|
-
else this._value = $0f54b57eb7ece508$var$BIGINT_ZERO;
|
|
37561
|
-
this._items = items;
|
|
37562
|
-
this._lookup = lookup;
|
|
37563
|
-
}
|
|
37564
|
-
static from(items) {
|
|
37565
|
-
let lookup = new Map();
|
|
37566
|
-
for(let i = 0; i < items.length; i++)lookup.set(items[i], $0f54b57eb7ece508$var$numberToBigInt(i));
|
|
37567
|
-
return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
|
|
37568
|
-
items: items,
|
|
37569
|
-
lookup: lookup
|
|
37570
|
-
});
|
|
37571
|
-
}
|
|
37572
|
-
static union(a, b) {
|
|
37573
|
-
return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
|
|
37574
|
-
initial: $0f54b57eb7ece508$var$bitUnion(a._value, b._value),
|
|
37575
|
-
lookup: a._lookup,
|
|
37576
|
-
items: a._items
|
|
37577
|
-
});
|
|
37578
|
-
}
|
|
37579
|
-
#getIndex(item) {
|
|
37580
|
-
return (0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(this._lookup.get(item), "Item is missing from BitSet");
|
|
37581
|
-
}
|
|
37582
|
-
add(item) {
|
|
37583
|
-
this._value |= $0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item);
|
|
37584
|
-
}
|
|
37585
|
-
delete(item) {
|
|
37586
|
-
this._value &= ~($0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item));
|
|
37587
|
-
}
|
|
37588
|
-
has(item) {
|
|
37589
|
-
return Boolean(this._value & $0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item));
|
|
37590
|
-
}
|
|
37591
|
-
intersect(v) {
|
|
37592
|
-
this._value = this._value & v._value;
|
|
37593
|
-
}
|
|
37594
|
-
union(v) {
|
|
37595
|
-
this._value = $0f54b57eb7ece508$var$bitUnion(this._value, v._value);
|
|
37596
|
-
}
|
|
37597
|
-
clear() {
|
|
37598
|
-
this._value = $0f54b57eb7ece508$var$BIGINT_ZERO;
|
|
37599
|
-
}
|
|
37600
|
-
cloneEmpty() {
|
|
37601
|
-
return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
|
|
37602
|
-
lookup: this._lookup,
|
|
37603
|
-
items: this._items
|
|
37604
|
-
});
|
|
37605
|
-
}
|
|
37606
|
-
clone() {
|
|
37607
|
-
return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
|
|
37608
|
-
lookup: this._lookup,
|
|
37609
|
-
items: this._items,
|
|
37610
|
-
initial: this._value
|
|
37611
|
-
});
|
|
37612
|
-
}
|
|
37613
|
-
values() {
|
|
37614
|
-
let values = [];
|
|
37615
|
-
let tmpValue = this._value;
|
|
37616
|
-
let i;
|
|
37617
|
-
// This implementation is optimized for BitSets that contain a very small percentage
|
|
37618
|
-
// of items compared to the total number of potential items. This makes sense for
|
|
37619
|
-
// our bundler use-cases where Sets often contain <1% coverage of the total item count.
|
|
37620
|
-
// In cases where Sets contain a larger percentage of the total items, a regular looping
|
|
37621
|
-
// strategy would be more performant.
|
|
37622
|
-
while(tmpValue > $0f54b57eb7ece508$var$BIGINT_ZERO){
|
|
37623
|
-
// Get last set bit
|
|
37624
|
-
i = tmpValue.toString(2).length - 1;
|
|
37625
|
-
values.push(this._items[i]);
|
|
37626
|
-
// Unset last set bit
|
|
37627
|
-
tmpValue &= ~($0f54b57eb7ece508$var$BIGINT_ONE << $0f54b57eb7ece508$var$numberToBigInt(i));
|
|
37628
|
-
}
|
|
37629
|
-
return values;
|
|
37630
|
-
}
|
|
37631
|
-
}
|
|
37632
|
-
|
|
37633
|
-
|
|
37634
37542
|
var $166044cf9ce846b7$exports = {};
|
|
37635
37543
|
"use strict";
|
|
37636
37544
|
var $d1a267d3dbd285eb$exports = {};
|