@mainsail/utils 0.0.1-rc.2 → 0.0.1-rc.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.
- package/distribution/assert.d.ts +12 -11
- package/distribution/assert.d.ts.map +1 -1
- package/distribution/assert.js.map +1 -1
- package/distribution/big-number.js +5 -4
- package/distribution/big-number.js.map +1 -1
- package/distribution/byte-buffer.d.ts.map +1 -1
- package/distribution/byte-buffer.js +37 -51
- package/distribution/byte-buffer.js.map +1 -1
- package/distribution/capped-map.js +7 -20
- package/distribution/capped-map.js.map +1 -1
- package/distribution/capped-set.js +8 -21
- package/distribution/capped-set.js.map +1 -1
- package/distribution/collection.js +12 -27
- package/distribution/collection.js.map +1 -1
- package/distribution/lock.js +11 -26
- package/distribution/lock.js.map +1 -1
- package/distribution/nsect.js +17 -30
- package/distribution/nsect.js.map +1 -1
- package/package.json +9 -9
package/distribution/assert.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
array
|
|
3
|
-
bigint
|
|
4
|
-
boolean
|
|
5
|
-
buffer
|
|
6
|
-
defined
|
|
7
|
-
number
|
|
8
|
-
object
|
|
9
|
-
string
|
|
10
|
-
symbol
|
|
11
|
-
undefined
|
|
1
|
+
export type Assert = {
|
|
2
|
+
array<T>(value: unknown): asserts value is Array<T>;
|
|
3
|
+
bigint(value: unknown): asserts value is bigint;
|
|
4
|
+
boolean(value: unknown): asserts value is boolean;
|
|
5
|
+
buffer(value: unknown): asserts value is Buffer;
|
|
6
|
+
defined<T>(value: undefined | null | T): asserts value is NonNullable<T>;
|
|
7
|
+
number(value: unknown): asserts value is number;
|
|
8
|
+
object(value: unknown): asserts value is Record<string, any>;
|
|
9
|
+
string(value: unknown): asserts value is string;
|
|
10
|
+
symbol(value: unknown): asserts value is symbol;
|
|
11
|
+
undefined(value: unknown): asserts value is undefined;
|
|
12
12
|
};
|
|
13
|
+
export declare const assert: Assert;
|
|
13
14
|
//# sourceMappingURL=assert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../source/assert.ts"],"names":[],"mappings":"AAMA,
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../source/assert.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IAChD,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IAChD,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7D,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IAChD,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAYpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../source/assert.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,SAAkB,EAAE,WAAmB,EAAqB,EAAE;IACjF,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,4BAA4B,WAAW,IAAI,CAAC,CAAC;IAC9D,CAAC;AACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../source/assert.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,SAAkB,EAAE,WAAmB,EAAqB,EAAE;IACjF,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,4BAA4B,WAAW,IAAI,CAAC,CAAC;IAC9D,CAAC;AACF,CAAC,CAAC;AAeF,MAAM,CAAC,MAAM,MAAM,GAAW;IAC7B,KAAK,EAAE,CAAI,KAAc,EAA6B,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAClG,MAAM,EAAE,CAAC,KAAc,EAA2B,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,QAAQ,CAAC;IACpG,OAAO,EAAE,CAAC,KAAc,EAA4B,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,SAAS,EAAE,SAAS,CAAC;IACxG,MAAM,EAAE,CAAC,KAAc,EAA2B,EAAE,CAAC,UAAU,CAAC,KAAK,YAAY,MAAM,EAAE,QAAQ,CAAC;IAClG,OAAO,EAAE,CAAI,KAA2B,EAAmC,EAAE,CAC5E,UAAU,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,4BAA4B,CAAC;IAChF,MAAM,EAAE,CAAC,KAAc,EAA2B,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,QAAQ,CAAC;IACpG,MAAM,EAAE,CAAC,KAAc,EAAwC,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,QAAQ,CAAC;IACjH,MAAM,EAAE,CAAC,KAAc,EAA2B,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,QAAQ,CAAC;IACpG,MAAM,EAAE,CAAC,KAAc,EAA2B,EAAE,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,QAAQ,CAAC;IACpG,SAAS,EAAE,CAAC,KAAc,EAA8B,EAAE,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,WAAW,CAAC;CACvG,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export class BigNumber {
|
|
2
|
+
static ZERO = new BigNumber(0);
|
|
3
|
+
static ONE = new BigNumber(1);
|
|
4
|
+
static WEI = new BigNumber(1e18);
|
|
5
|
+
static UINT256_MAX = new BigNumber(2n ** 256n - 1n);
|
|
6
|
+
value;
|
|
2
7
|
constructor(value) {
|
|
3
8
|
this.value = this.toBigNumber(value);
|
|
4
9
|
}
|
|
@@ -70,8 +75,4 @@ export class BigNumber {
|
|
|
70
75
|
return BigInt(value);
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
|
-
BigNumber.ZERO = new BigNumber(0);
|
|
74
|
-
BigNumber.ONE = new BigNumber(1);
|
|
75
|
-
BigNumber.WEI = new BigNumber(1e18);
|
|
76
|
-
BigNumber.UINT256_MAX = new BigNumber(2n ** 256n - 1n);
|
|
77
78
|
//# sourceMappingURL=big-number.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"big-number.js","sourceRoot":"","sources":["../source/big-number.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;
|
|
1
|
+
{"version":3,"file":"big-number.js","sourceRoot":"","sources":["../source/big-number.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;IACd,MAAM,CAAU,IAAI,GAAc,IAAI,SAAS,CAAC,CA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,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEO,WAAW,CAAC,KAAoB;QACvC,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;YAChC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACrB,CAAC;QAED,OAAO,MAAM,CAAC,KAAY,CAAC,CAAC;IAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byte-buffer.d.ts","sourceRoot":"","sources":["../source/byte-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"byte-buffer.d.ts","sourceRoot":"","sources":["../source/byte-buffer.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;;IAKtB,OAAO;WAIO,QAAQ,CAAC,IAAI,EAAE,MAAM;WAIrB,UAAU,CAAC,MAAM,EAAE,MAAM;IAIhC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,SAAS,IAAI,MAAM;IAMnB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,UAAU,IAAI,MAAM;IAMpB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,UAAU,IAAI,MAAM;IAMpB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAUhC,UAAU,IAAI,MAAM;IAMpB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQhC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAcjC,UAAU,IAAI,MAAM;IAMpB,WAAW,IAAI,MAAM;IAMrB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAgB/B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAkBjC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI/B,YAAY,IAAI,MAAM;IAItB,kBAAkB,IAAI,MAAM;IAI5B,SAAS,IAAI,MAAM;IAInB,eAAe,IAAI,MAAM;IAIzB,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQ1B,QAAQ,IAAI,MAAM;CAGzB"}
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ByteBuffer_buffer, _ByteBuffer_offset, _ByteBuffer_marker;
|
|
13
|
-
import { ethers } from "ethers";
|
|
14
|
-
import { BigNumber } from "./big-number.js";
|
|
1
|
+
import { bytesToBigInt, padBytes, toBytes, trim } from "viem";
|
|
15
2
|
export class ByteBuffer {
|
|
3
|
+
#buffer;
|
|
4
|
+
#offset = 0;
|
|
5
|
+
#marker = 0;
|
|
16
6
|
constructor(buffer) {
|
|
17
|
-
|
|
18
|
-
_ByteBuffer_offset.set(this, 0);
|
|
19
|
-
_ByteBuffer_marker.set(this, 0);
|
|
20
|
-
__classPrivateFieldSet(this, _ByteBuffer_buffer, buffer, "f");
|
|
7
|
+
this.#buffer = buffer;
|
|
21
8
|
}
|
|
22
9
|
static fromSize(size) {
|
|
23
10
|
return new ByteBuffer(Buffer.alloc(size));
|
|
@@ -26,66 +13,66 @@ export class ByteBuffer {
|
|
|
26
13
|
return new ByteBuffer(buffer);
|
|
27
14
|
}
|
|
28
15
|
writeUint8(value) {
|
|
29
|
-
|
|
16
|
+
this.#offset = this.#buffer.writeUInt8(value, this.#offset);
|
|
30
17
|
}
|
|
31
18
|
readUint8() {
|
|
32
|
-
const value =
|
|
33
|
-
|
|
19
|
+
const value = this.#buffer.readUInt8(this.#offset);
|
|
20
|
+
this.#offset += 1;
|
|
34
21
|
return value;
|
|
35
22
|
}
|
|
36
23
|
writeUint16(value) {
|
|
37
|
-
|
|
24
|
+
this.#offset = this.#buffer.writeUInt16LE(value, this.#offset);
|
|
38
25
|
}
|
|
39
26
|
readUint16() {
|
|
40
|
-
const value =
|
|
41
|
-
|
|
27
|
+
const value = this.#buffer.readUInt16LE(this.#offset);
|
|
28
|
+
this.#offset += 2;
|
|
42
29
|
return value;
|
|
43
30
|
}
|
|
44
31
|
writeUint32(value) {
|
|
45
|
-
|
|
32
|
+
this.#offset = this.#buffer.writeUInt32LE(value, this.#offset);
|
|
46
33
|
}
|
|
47
34
|
readUint32() {
|
|
48
|
-
const value =
|
|
49
|
-
|
|
35
|
+
const value = this.#buffer.readUInt32LE(this.#offset);
|
|
36
|
+
this.#offset += 4;
|
|
50
37
|
return value;
|
|
51
38
|
}
|
|
52
39
|
writeUint48(value) {
|
|
53
40
|
if (value < 0 || value > 2 ** 48 - 1) {
|
|
54
41
|
throw new Error(`The value of "value" is out of range. It must be >= 0 and <= ${2 ** 48 - 1}. Received ${value}`);
|
|
55
42
|
}
|
|
56
|
-
|
|
43
|
+
this.#offset = this.#buffer.writeUIntLE(value, this.#offset, 6);
|
|
57
44
|
}
|
|
58
45
|
readUint48() {
|
|
59
|
-
const value =
|
|
60
|
-
|
|
46
|
+
const value = this.#buffer.readUIntLE(this.#offset, 6);
|
|
47
|
+
this.#offset += 6;
|
|
61
48
|
return value;
|
|
62
49
|
}
|
|
63
50
|
writeUint64(value) {
|
|
64
51
|
if (typeof value !== "bigint") {
|
|
65
52
|
value = BigInt(value);
|
|
66
53
|
}
|
|
67
|
-
|
|
54
|
+
this.#offset = this.#buffer.writeBigUInt64LE(value, this.#offset);
|
|
68
55
|
}
|
|
69
56
|
writeUint256(value) {
|
|
70
57
|
if (typeof value !== "bigint") {
|
|
71
58
|
value = BigInt(value);
|
|
72
59
|
}
|
|
73
|
-
const bytes =
|
|
60
|
+
const bytes = toBytes(value);
|
|
74
61
|
if (bytes.byteLength > 32) {
|
|
75
62
|
throw new Error("value must fit into uint256");
|
|
76
63
|
}
|
|
77
|
-
const padded =
|
|
78
|
-
this.writeBytes(Buffer.from(
|
|
64
|
+
const padded = padBytes(bytes, { size: 32 });
|
|
65
|
+
this.writeBytes(Buffer.from(padded));
|
|
79
66
|
}
|
|
80
67
|
readUint64() {
|
|
81
|
-
const value =
|
|
82
|
-
|
|
68
|
+
const value = this.#buffer.readBigUInt64LE(this.#offset);
|
|
69
|
+
this.#offset += 8;
|
|
83
70
|
return value;
|
|
84
71
|
}
|
|
85
72
|
readUint256() {
|
|
86
73
|
const bytes = this.readBytes(32);
|
|
87
|
-
const parsed =
|
|
88
|
-
return
|
|
74
|
+
const parsed = trim(bytes, { dir: "left" });
|
|
75
|
+
return bytesToBigInt(parsed);
|
|
89
76
|
}
|
|
90
77
|
writeBytes(value) {
|
|
91
78
|
if (value.length > this.getRemainderLength()) {
|
|
@@ -97,7 +84,7 @@ export class ByteBuffer {
|
|
|
97
84
|
(value.length - this.getRemainderLength()) +
|
|
98
85
|
")");
|
|
99
86
|
}
|
|
100
|
-
|
|
87
|
+
this.#offset += value.copy(this.#buffer, this.#offset);
|
|
101
88
|
}
|
|
102
89
|
readBytes(length) {
|
|
103
90
|
if (length > this.getRemainderLength()) {
|
|
@@ -109,40 +96,39 @@ export class ByteBuffer {
|
|
|
109
96
|
(length - this.getRemainderLength()) +
|
|
110
97
|
")");
|
|
111
98
|
}
|
|
112
|
-
const value =
|
|
113
|
-
|
|
99
|
+
const value = this.#buffer.subarray(this.#offset, this.#offset + length);
|
|
100
|
+
this.#offset += length;
|
|
114
101
|
return value;
|
|
115
102
|
}
|
|
116
103
|
readHex(length) {
|
|
117
104
|
return this.readBytes(length);
|
|
118
105
|
}
|
|
119
106
|
getRemainder() {
|
|
120
|
-
return
|
|
107
|
+
return this.#buffer.subarray(this.#offset);
|
|
121
108
|
}
|
|
122
109
|
getRemainderLength() {
|
|
123
|
-
return
|
|
110
|
+
return this.#buffer.length - this.#offset;
|
|
124
111
|
}
|
|
125
112
|
getResult() {
|
|
126
|
-
return
|
|
113
|
+
return this.#buffer.subarray(0, this.#offset);
|
|
127
114
|
}
|
|
128
115
|
getResultLength() {
|
|
129
|
-
return
|
|
116
|
+
return this.#offset;
|
|
130
117
|
}
|
|
131
118
|
mark() {
|
|
132
|
-
|
|
119
|
+
this.#marker = this.#offset;
|
|
133
120
|
}
|
|
134
121
|
reset() {
|
|
135
|
-
|
|
122
|
+
this.#offset = this.#marker ?? 0;
|
|
136
123
|
}
|
|
137
124
|
skip(length) {
|
|
138
|
-
if (length < -
|
|
125
|
+
if (length < -this.#offset || length > this.getRemainderLength()) {
|
|
139
126
|
throw new Error("Jump over buffer boundary.");
|
|
140
127
|
}
|
|
141
|
-
|
|
128
|
+
this.#offset += length;
|
|
142
129
|
}
|
|
143
130
|
toBuffer() {
|
|
144
|
-
return Buffer.from(
|
|
131
|
+
return Buffer.from(this.#buffer.buffer);
|
|
145
132
|
}
|
|
146
133
|
}
|
|
147
|
-
_ByteBuffer_buffer = new WeakMap(), _ByteBuffer_offset = new WeakMap(), _ByteBuffer_marker = new WeakMap();
|
|
148
134
|
//# sourceMappingURL=byte-buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byte-buffer.js","sourceRoot":"","sources":["../source/byte-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"byte-buffer.js","sourceRoot":"","sources":["../source/byte-buffer.ts"],"names":[],"mappings":"AAAA,OAAO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AAI,CAAC,OAAO,IAAI,MAAM,CAAC;IACxB,CAAC;IAEM,QAAQ;QACd,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;CACD"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _CappedMap_maxSize;
|
|
13
1
|
export class CappedMap {
|
|
2
|
+
store = new Map();
|
|
3
|
+
#maxSize;
|
|
14
4
|
constructor(maxSize) {
|
|
15
|
-
this
|
|
16
|
-
_CappedMap_maxSize.set(this, void 0);
|
|
17
|
-
__classPrivateFieldSet(this, _CappedMap_maxSize, maxSize, "f");
|
|
5
|
+
this.#maxSize = maxSize;
|
|
18
6
|
}
|
|
19
7
|
get(key) {
|
|
20
8
|
return this.store.get(key);
|
|
21
9
|
}
|
|
22
10
|
set(key, value) {
|
|
23
|
-
if (this.store.size >=
|
|
11
|
+
if (this.store.size >= this.#maxSize) {
|
|
24
12
|
this.store.delete([...this.store][0][0]);
|
|
25
13
|
}
|
|
26
14
|
this.store = this.store.set(key, value);
|
|
@@ -39,9 +27,9 @@ export class CappedMap {
|
|
|
39
27
|
this.store.clear();
|
|
40
28
|
}
|
|
41
29
|
resize(maxSize) {
|
|
42
|
-
|
|
43
|
-
if (this.store.size >
|
|
44
|
-
this.store = new Map([...this.store].slice(-Math.max(0,
|
|
30
|
+
this.#maxSize = maxSize;
|
|
31
|
+
if (this.store.size > this.#maxSize) {
|
|
32
|
+
this.store = new Map([...this.store].slice(-Math.max(0, this.#maxSize)));
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
35
|
first() {
|
|
@@ -60,5 +48,4 @@ export class CappedMap {
|
|
|
60
48
|
return this.store.size;
|
|
61
49
|
}
|
|
62
50
|
}
|
|
63
|
-
_CappedMap_maxSize = new WeakMap();
|
|
64
51
|
//# sourceMappingURL=capped-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capped-map.js","sourceRoot":"","sources":["../source/capped-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capped-map.js","sourceRoot":"","sources":["../source/capped-map.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAS;IACX,KAAK,GAAc,IAAI,GAAG,EAAQ,CAAC;IAC7C,QAAQ,CAAS;IAEjB,YAAmB,OAAe;QACjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,GAAG,CAAC,GAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAEM,GAAG,CAAC,GAAM,EAAE,KAAQ;QAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1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AAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEM,MAAM;QACZ,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACxB,CAAC;CACD"}
|
|
@@ -1,34 +1,21 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _CappedSet_data, _CappedSet_maxSize;
|
|
13
1
|
// A Set that is capped in size and acts like a FIFO.
|
|
14
2
|
export class CappedSet {
|
|
3
|
+
#data = new Set();
|
|
4
|
+
#maxSize;
|
|
15
5
|
constructor(maxSize = 16_384) {
|
|
16
|
-
|
|
17
|
-
_CappedSet_maxSize.set(this, void 0);
|
|
18
|
-
__classPrivateFieldSet(this, _CappedSet_maxSize, maxSize, "f");
|
|
6
|
+
this.#maxSize = maxSize;
|
|
19
7
|
}
|
|
20
8
|
add(newElement) {
|
|
21
|
-
if (
|
|
22
|
-
const oldest =
|
|
9
|
+
if (this.#data.size >= this.#maxSize) {
|
|
10
|
+
const oldest = this.#data.values().next().value;
|
|
23
11
|
if (oldest !== undefined) {
|
|
24
|
-
|
|
12
|
+
this.#data.delete(oldest);
|
|
25
13
|
}
|
|
26
14
|
}
|
|
27
|
-
|
|
15
|
+
this.#data.add(newElement);
|
|
28
16
|
}
|
|
29
17
|
has(element) {
|
|
30
|
-
return
|
|
18
|
+
return this.#data.has(element);
|
|
31
19
|
}
|
|
32
20
|
}
|
|
33
|
-
_CappedSet_data = new WeakMap(), _CappedSet_maxSize = new WeakMap();
|
|
34
21
|
//# sourceMappingURL=capped-set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capped-set.js","sourceRoot":"","sources":["../source/capped-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capped-set.js","sourceRoot":"","sources":["../source/capped-set.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,OAAO,SAAS;IACZ,KAAK,GAAW,IAAI,GAAG,EAAK,CAAC;IACtC,QAAQ,CAAS;IAEjB,YAAmB,OAAO,GAAG,MAAM;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,GAAG,CAAC,UAAa;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YAEhD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC;QACF,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAEM,GAAG,CAAC,OAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACD"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _Collection_collection;
|
|
13
1
|
import { get } from "./get.js";
|
|
14
2
|
import { has } from "./has.js";
|
|
15
3
|
import { sample } from "./sample.js";
|
|
@@ -17,46 +5,44 @@ import { set } from "./set.js";
|
|
|
17
5
|
import { stringify } from "./stringify.js";
|
|
18
6
|
import { unset } from "./unset.js";
|
|
19
7
|
export class Collection {
|
|
20
|
-
|
|
21
|
-
_Collection_collection.set(this, {});
|
|
22
|
-
}
|
|
8
|
+
#collection = {};
|
|
23
9
|
all() {
|
|
24
|
-
return
|
|
10
|
+
return this.#collection;
|
|
25
11
|
}
|
|
26
12
|
entries() {
|
|
27
|
-
return Object.entries(
|
|
13
|
+
return Object.entries(this.#collection);
|
|
28
14
|
}
|
|
29
15
|
keys() {
|
|
30
|
-
return Object.keys(
|
|
16
|
+
return Object.keys(this.#collection);
|
|
31
17
|
}
|
|
32
18
|
values() {
|
|
33
|
-
return Object.values(
|
|
19
|
+
return Object.values(this.#collection);
|
|
34
20
|
}
|
|
35
21
|
pull(key) {
|
|
36
|
-
const item = get(
|
|
22
|
+
const item = get(this.#collection, key);
|
|
37
23
|
this.forget(key);
|
|
38
24
|
return item;
|
|
39
25
|
}
|
|
40
26
|
get(key) {
|
|
41
|
-
return get(
|
|
27
|
+
return get(this.#collection, key);
|
|
42
28
|
}
|
|
43
29
|
set(key, value) {
|
|
44
|
-
set(
|
|
30
|
+
set(this.#collection, key, value);
|
|
45
31
|
}
|
|
46
32
|
forget(key) {
|
|
47
|
-
unset(
|
|
33
|
+
unset(this.#collection, key);
|
|
48
34
|
}
|
|
49
35
|
flush() {
|
|
50
|
-
|
|
36
|
+
this.#collection = {};
|
|
51
37
|
}
|
|
52
38
|
has(key) {
|
|
53
|
-
return has(
|
|
39
|
+
return has(this.#collection, key);
|
|
54
40
|
}
|
|
55
41
|
missing(key) {
|
|
56
42
|
return !this.has(key);
|
|
57
43
|
}
|
|
58
44
|
count() {
|
|
59
|
-
return Object.keys(
|
|
45
|
+
return Object.keys(this.#collection).length;
|
|
60
46
|
}
|
|
61
47
|
isEmpty() {
|
|
62
48
|
return this.count() <= 0;
|
|
@@ -75,5 +61,4 @@ export class Collection {
|
|
|
75
61
|
return stringify(collection);
|
|
76
62
|
}
|
|
77
63
|
}
|
|
78
|
-
_Collection_collection = new WeakMap();
|
|
79
64
|
//# sourceMappingURL=collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../source/collection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../source/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAA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C,GAAW;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAEM,KAAK;QACX,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IAC7C,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEM,UAAU;QAChB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAEM,MAAM;QACZ,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9B,CAAC;IAEM,MAAM;QACZ,MAAM,UAAU,GAAsB,EAAE,CAAC;QAEzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YAC3C,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,OAAO,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;CACD"}
|
package/distribution/lock.js
CHANGED
|
@@ -1,45 +1,31 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _Lock_exclusivePromise, _Lock_nonExclusivePromises;
|
|
13
1
|
export class Lock {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_Lock_nonExclusivePromises.set(this, new Set());
|
|
17
|
-
}
|
|
2
|
+
#exclusivePromise;
|
|
3
|
+
#nonExclusivePromises = new Set();
|
|
18
4
|
async runNonExclusive(callback) {
|
|
19
|
-
while (
|
|
5
|
+
while (this.#exclusivePromise) {
|
|
20
6
|
try {
|
|
21
|
-
await
|
|
7
|
+
await this.#exclusivePromise;
|
|
22
8
|
}
|
|
23
9
|
catch { }
|
|
24
10
|
}
|
|
25
11
|
const nonExclusivePromise = callback();
|
|
26
12
|
try {
|
|
27
|
-
|
|
13
|
+
this.#nonExclusivePromises.add(nonExclusivePromise);
|
|
28
14
|
return await nonExclusivePromise;
|
|
29
15
|
}
|
|
30
16
|
finally {
|
|
31
|
-
|
|
17
|
+
this.#nonExclusivePromises.delete(nonExclusivePromise);
|
|
32
18
|
}
|
|
33
19
|
}
|
|
34
20
|
async runExclusive(callback) {
|
|
35
|
-
while (
|
|
21
|
+
while (this.#exclusivePromise) {
|
|
36
22
|
try {
|
|
37
|
-
await
|
|
23
|
+
await this.#exclusivePromise;
|
|
38
24
|
}
|
|
39
25
|
catch { }
|
|
40
26
|
}
|
|
41
27
|
const exclusivePromise = (async () => {
|
|
42
|
-
await Promise.all([...
|
|
28
|
+
await Promise.all([...this.#nonExclusivePromises].map(async (nonExclusivePromise) => {
|
|
43
29
|
try {
|
|
44
30
|
await nonExclusivePromise;
|
|
45
31
|
}
|
|
@@ -48,13 +34,12 @@ export class Lock {
|
|
|
48
34
|
return await callback();
|
|
49
35
|
})();
|
|
50
36
|
try {
|
|
51
|
-
|
|
37
|
+
this.#exclusivePromise = exclusivePromise;
|
|
52
38
|
return await exclusivePromise;
|
|
53
39
|
}
|
|
54
40
|
finally {
|
|
55
|
-
|
|
41
|
+
this.#exclusivePromise = undefined;
|
|
56
42
|
}
|
|
57
43
|
}
|
|
58
44
|
}
|
|
59
|
-
_Lock_exclusivePromise = new WeakMap(), _Lock_nonExclusivePromises = new WeakMap();
|
|
60
45
|
//# sourceMappingURL=lock.js.map
|
package/distribution/lock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../source/lock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../source/lock.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,IAAI;IAChB,iBAAiB,CAAoB;IAE5B,qBAAqB,GAA0B,IAAI,GAAG,EAAoB,CAAC;IAE7E,KAAK,CAAC,eAAe,CAAI,QAA0B;QACzD,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,iBAAiB,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACX,CAAC;QAED,MAAM,mBAAmB,GAAG,QAAQ,EAAE,CAAC;QAEvC,IAAI,CAAC;YACJ,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YACpD,OAAO,MAAM,mBAAmB,CAAC;QAClC,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACxD,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,YAAY,CAAI,QAA0B;QACtD,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,iBAAiB,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACX,CAAC;QAED,MAAM,gBAAgB,GAAG,CAAC,KAAK,IAAI,EAAE;YACpC,MAAM,OAAO,CAAC,GAAG,CAChB,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE;gBACjE,IAAI,CAAC;oBACJ,MAAM,mBAAmB,CAAC;gBAC3B,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;YACX,CAAC,CAAC,CACF,CAAC;YAEF,OAAO,MAAM,QAAQ,EAAE,CAAC;QACzB,CAAC,CAAC,EAAE,CAAC;QAEL,IAAI,CAAC;YACJ,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;YAC1C,OAAO,MAAM,gBAAgB,CAAC;QAC/B,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACpC,CAAC;IACF,CAAC;CACD"}
|
package/distribution/nsect.js
CHANGED
|
@@ -1,34 +1,21 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _NSect_instances, _NSect_nAry, _NSect_probe, _NSect_calcProbes;
|
|
13
1
|
import assert from "assert";
|
|
14
2
|
export class NSect {
|
|
3
|
+
#nAry;
|
|
4
|
+
#probe;
|
|
15
5
|
constructor(nAry, probe) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
_NSect_probe.set(this, void 0);
|
|
19
|
-
__classPrivateFieldSet(this, _NSect_nAry, nAry, "f");
|
|
20
|
-
__classPrivateFieldSet(this, _NSect_probe, probe, "f");
|
|
6
|
+
this.#nAry = nAry;
|
|
7
|
+
this.#probe = probe;
|
|
21
8
|
}
|
|
22
9
|
async find(low, high) {
|
|
23
10
|
let highestMatching;
|
|
24
11
|
for (;;) {
|
|
25
|
-
const indexesToProbe =
|
|
26
|
-
const temporary = await
|
|
12
|
+
const indexesToProbe = this.#calcProbes(low, high);
|
|
13
|
+
const temporary = await this.#probe(indexesToProbe);
|
|
27
14
|
if (temporary === undefined) {
|
|
28
15
|
break;
|
|
29
16
|
}
|
|
30
17
|
highestMatching = temporary;
|
|
31
|
-
if (low +
|
|
18
|
+
if (low + this.#nAry >= high) {
|
|
32
19
|
// The range is narrowed so much that we probed every element in the range.
|
|
33
20
|
// No need to narrow further - highestMatching contains the definitive result.
|
|
34
21
|
break;
|
|
@@ -78,15 +65,15 @@ export class NSect {
|
|
|
78
65
|
}
|
|
79
66
|
return highestMatching;
|
|
80
67
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
#calcProbes(low, high) {
|
|
69
|
+
assert(low <= high, `${low} <= ${high}`);
|
|
70
|
+
const diff = high - low;
|
|
71
|
+
const p = new Set();
|
|
72
|
+
for (let index = 0; index < this.#nAry + 1; index++) {
|
|
73
|
+
const h = low + Math.round((diff * index) / this.#nAry);
|
|
74
|
+
p.add(h);
|
|
75
|
+
}
|
|
76
|
+
return [...p];
|
|
89
77
|
}
|
|
90
|
-
|
|
91
|
-
};
|
|
78
|
+
}
|
|
92
79
|
//# sourceMappingURL=nsect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nsect.js","sourceRoot":"","sources":["../source/nsect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nsect.js","sourceRoot":"","sources":["../source/nsect.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,MAAM,OAAO,KAAK;IACR,KAAK,CAAS;IACd,MAAM,CAAgB;IAE/B,YAAmB,IAAY,EAAE,KAAoB;QACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,IAAY;QAC1C,IAAI,eAAmC,CAAC;QAExC,SAAS,CAAC;YACT,MAAM,cAAc,GAAa,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAE7D,MAAM,SAAS,GAAuB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAExE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC7B,MAAM;YACP,CAAC;YAED,eAAe,GAAG,SAAS,CAAC;YAE5B,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;gBAC9B,2EAA2E;gBAC3E,8EAA8E;gBAC9E,MAAM;YACP,CAAC;YAED,4EAA4E;YAC5E,0DAA0D;YAC1D,kFAAkF;YAClF,8DAA8D;YAC9D,2FAA2F;YAC3F,kFAAkF;YAClF,kFAAkF;YAClF,gFAAgF;YAChF,oFAAoF;YACpF,oBAAoB;YAEpB,UAAU;YACV,6BAA6B;YAC7B,IAAI,eAAe,KAAK,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/C,MAAM;YACP,CAAC;YAED,2CAA2C;YAC3C,yBAAyB;YACzB,uCAAuC;YACvC,uCAAuC;YACvC,2CAA2C;YAC3C,2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;QACV,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACf,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainsail/utils",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.4",
|
|
4
4
|
"description": "Performance oriented implementations of commonly used functions in TypeScript.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"contributors": [],
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@hapi/bourne": "3.0.0",
|
|
20
20
|
"deepmerge": "4.3.1",
|
|
21
|
-
"ethers": "6.13.5",
|
|
22
21
|
"fast-copy": "3.0.2",
|
|
23
22
|
"fast-deep-equal": "3.1.3",
|
|
24
23
|
"fast-sort": "3.4.1",
|
|
25
24
|
"ipaddr.js": "2.2.0",
|
|
26
25
|
"nanomatch": "1.2.13",
|
|
27
|
-
"type-fest": "4.
|
|
26
|
+
"type-fest": "4.41.0",
|
|
27
|
+
"viem": "2.34.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@hapi/boom": "10.0.1",
|
|
31
|
-
"@hapi/hapi": "21.4.
|
|
31
|
+
"@hapi/hapi": "21.4.3",
|
|
32
32
|
"big-number": "2.0.0",
|
|
33
|
-
"bignumber.js": "9.1
|
|
34
|
-
"jsbi": "4.3.
|
|
33
|
+
"bignumber.js": "9.3.1",
|
|
34
|
+
"jsbi": "4.3.2",
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
|
-
"micro-bmark": "0.4.
|
|
36
|
+
"micro-bmark": "0.4.2",
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"uvu": "0.5.6"
|
|
39
39
|
},
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"bench": "pnpm run build && node benchmark/index.js",
|
|
45
|
-
"build": "
|
|
45
|
+
"build": "tsc -b",
|
|
46
46
|
"build:watch": "pnpm run clean && tsc -w",
|
|
47
|
-
"clean": "del distribution",
|
|
47
|
+
"clean": "del distribution && del tsconfig.tsbuildinfo",
|
|
48
48
|
"release": "pnpm publish --access public",
|
|
49
49
|
"test": "pnpm run uvu source .test.ts",
|
|
50
50
|
"test:coverage": "c8 -r=text -r=lcov --all pnpm run test",
|