@daneren2005/shared-memory-objects 1.1.0 → 1.2.0
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/README.md +78 -55
- package/dist/{src/allocated-memory.d.ts → allocated-memory.d.ts} +5 -4
- package/dist/allocated-memory.js +44 -37
- package/dist/allocated-memory.js.map +1 -1
- package/dist/{src/cached-item-list.d.ts → cached-item-list.d.ts} +3 -3
- package/dist/cached-item-list.js +70 -75
- package/dist/cached-item-list.js.map +1 -1
- package/dist/constant-string.d.ts +15 -0
- package/dist/constant-string.js +67 -0
- package/dist/constant-string.js.map +1 -0
- package/dist/interfaces/pow2.js +0 -2
- package/dist/interfaces/typed-array-constructor.js +0 -2
- package/dist/interfaces/typed-array.js +0 -2
- package/dist/{src/local-pool.d.ts → local-pool.d.ts} +2 -2
- package/dist/local-pool.js +89 -94
- package/dist/local-pool.js.map +1 -1
- package/dist/lock/read-write-lock.js +15 -21
- package/dist/lock/read-write-lock.js.map +1 -1
- package/dist/lock/simple-lock.js +9 -12
- package/dist/lock/simple-lock.js.map +1 -1
- package/dist/{src/memory-buffer.d.ts → memory-buffer.d.ts} +4 -4
- package/dist/memory-buffer.js +266 -326
- package/dist/memory-buffer.js.map +1 -1
- package/dist/{src/memory-heap.d.ts → memory-heap.d.ts} +2 -2
- package/dist/memory-heap.js +95 -115
- package/dist/memory-heap.js.map +1 -1
- package/dist/{src/serialize-object.d.ts → serialize-object.d.ts} +2 -2
- package/dist/serialize-object.js +43 -55
- package/dist/serialize-object.js.map +1 -1
- package/dist/{src/shared-list.d.ts → shared-list.d.ts} +3 -3
- package/dist/shared-list.js +124 -164
- package/dist/shared-list.js.map +1 -1
- package/dist/{src/shared-map.d.ts → shared-map.d.ts} +2 -2
- package/dist/shared-map.js +102 -138
- package/dist/shared-map.js.map +1 -1
- package/dist/{src/shared-pointer-list.d.ts → shared-pointer-list.d.ts} +3 -3
- package/dist/shared-pointer-list.js +45 -48
- package/dist/shared-pointer-list.js.map +1 -1
- package/dist/{src/shared-pool.d.ts → shared-pool.d.ts} +11 -8
- package/dist/shared-pool.js +144 -164
- package/dist/shared-pool.js.map +1 -1
- package/dist/shared-stack.d.ts +46 -0
- package/dist/shared-stack.js +144 -0
- package/dist/shared-stack.js.map +1 -0
- package/dist/{src/shared-string.d.ts → shared-string.d.ts} +2 -2
- package/dist/shared-string.js +72 -78
- package/dist/shared-string.js.map +1 -1
- package/dist/{src/shared-vector.d.ts → shared-vector.d.ts} +4 -4
- package/dist/shared-vector.js +146 -164
- package/dist/shared-vector.js.map +1 -1
- package/dist/utils/16-from-32-array.js +14 -16
- package/dist/utils/16-from-32-array.js.map +1 -1
- package/dist/utils/16-from-64-array.js +15 -10
- package/dist/utils/16-from-64-array.js.map +1 -1
- package/dist/utils/atomic-math.js +30 -32
- package/dist/utils/atomic-math.js.map +1 -1
- package/dist/utils/float32-atomics.js +18 -22
- package/dist/utils/float32-atomics.js.map +1 -1
- package/dist/utils/float64-atomics.js +18 -22
- package/dist/utils/float64-atomics.js.map +1 -1
- package/dist/utils/pointer.js +34 -44
- package/dist/utils/pointer.js.map +1 -1
- package/dist/{src/utils → utils}/typedarray.d.ts +47 -47
- package/dist/utils/typedarray.js +36 -43
- package/dist/utils/typedarray.js.map +1 -1
- package/package.json +22 -22
- package/dist/interfaces/pow2.js.map +0 -1
- package/dist/interfaces/typed-array-constructor.js.map +0 -1
- package/dist/interfaces/typed-array.js.map +0 -1
- /package/dist/{src/interfaces → interfaces}/pow2.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/typed-array-constructor.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/typed-array.d.ts +0 -0
- /package/dist/{src/lock → lock}/read-write-lock.d.ts +0 -0
- /package/dist/{src/lock → lock}/simple-lock.d.ts +0 -0
- /package/dist/{src/utils → utils}/16-from-32-array.d.ts +0 -0
- /package/dist/{src/utils → utils}/16-from-64-array.d.ts +0 -0
- /package/dist/{src/utils → utils}/atomic-math.d.ts +0 -0
- /package/dist/{src/utils → utils}/float32-atomics.d.ts +0 -0
- /package/dist/{src/utils → utils}/float64-atomics.d.ts +0 -0
- /package/dist/{src/utils → utils}/pointer.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"float32-atomics.js","sources":["../../src/utils/float32-atomics.ts"],"sourcesContent":["// For doing Atomic operations on floats in SharedArrayBuffers\nconst buffer = new ArrayBuffer(4);\nconst float32 = new Float32Array(buffer);\nconst int32 = new Int32Array(buffer);\n\nexport function loadFloat32(data: Int32Array | Uint32Array | Float32Array, index: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.load(data, index));\n}\nexport function storeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\tAtomics.store(data, index, convertFloat32ToInt32(value));\n}\n\nexport function convertInt32ToFloat32(value: number) {\n\tint32[0] = value;\n\n\treturn float32[0];\n}\nexport function convertFloat32ToInt32(value: number) {\n\tfloat32[0] = value;\n\n\treturn int32[0];\n}\n\nexport function exchangeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.exchange(data, index, convertFloat32ToInt32(value)));\n}\n\nexport function compareExchangeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, expectedValue: number, replacementValue: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.compareExchange(data, index, convertFloat32ToInt32(expectedValue), convertFloat32ToInt32(replacementValue)));\n}"],"
|
|
1
|
+
{"version":3,"file":"float32-atomics.js","names":[],"sources":["../../src/utils/float32-atomics.ts"],"sourcesContent":["// For doing Atomic operations on floats in SharedArrayBuffers\nconst buffer = new ArrayBuffer(4);\nconst float32 = new Float32Array(buffer);\nconst int32 = new Int32Array(buffer);\n\nexport function loadFloat32(data: Int32Array | Uint32Array | Float32Array, index: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.load(data, index));\n}\nexport function storeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\tAtomics.store(data, index, convertFloat32ToInt32(value));\n}\n\nexport function convertInt32ToFloat32(value: number) {\n\tint32[0] = value;\n\n\treturn float32[0];\n}\nexport function convertFloat32ToInt32(value: number) {\n\tfloat32[0] = value;\n\n\treturn int32[0];\n}\n\nexport function exchangeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.exchange(data, index, convertFloat32ToInt32(value)));\n}\n\nexport function compareExchangeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, expectedValue: number, replacementValue: number) {\n\tif(data instanceof Float32Array) {\n\t\tdata = new Int32Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt32ToFloat32(Atomics.compareExchange(data, index, convertFloat32ToInt32(expectedValue), convertFloat32ToInt32(replacementValue)));\n}"],"mappings":";AACA,IAAM,oBAAS,IAAI,YAAY,CAAC,GAC1B,IAAU,IAAI,aAAa,CAAM,GACjC,IAAQ,IAAI,WAAW,CAAM;AAEnC,SAAgB,EAAY,GAA+C,GAAe;CAKzF,OAJG,aAAgB,iBAClB,IAAO,IAAI,WAAW,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAGzD,EAAsB,QAAQ,KAAK,GAAM,CAAK,CAAC;AACvD;AACA,SAAgB,EAAa,GAA+C,GAAe,GAAe;CAKzG,AAJG,aAAgB,iBAClB,IAAO,IAAI,WAAW,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAGhE,QAAQ,MAAM,GAAM,GAAO,EAAsB,CAAK,CAAC;AACxD;AAEA,SAAgB,EAAsB,GAAe;CAGpD,OAFA,EAAM,KAAK,GAEJ,EAAQ;AAChB;AACA,SAAgB,EAAsB,GAAe;CAGpD,OAFA,EAAQ,KAAK,GAEN,EAAM;AACd;AAEA,SAAgB,EAAgB,GAA+C,GAAe,GAAe;CAK5G,OAJG,aAAgB,iBAClB,IAAO,IAAI,WAAW,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAGzD,EAAsB,QAAQ,SAAS,GAAM,GAAO,EAAsB,CAAK,CAAC,CAAC;AACzF;AAEA,SAAgB,EAAuB,GAA+C,GAAe,GAAuB,GAA0B;CAKrJ,OAJG,aAAgB,iBAClB,IAAO,IAAI,WAAW,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAGzD,EAAsB,QAAQ,gBAAgB,GAAM,GAAO,EAAsB,CAAa,GAAG,EAAsB,CAAgB,CAAC,CAAC;AACjJ"}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/utils/float64-atomics.ts
|
|
2
|
+
var e = /* @__PURE__ */ new ArrayBuffer(8), t = new Float64Array(e), n = new BigInt64Array(e);
|
|
3
|
+
function r(e, t) {
|
|
4
|
+
return e instanceof Float64Array && (e = new BigInt64Array(e.buffer, e.byteOffset, e.length)), a(Atomics.load(e, t));
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
6
|
+
function i(e, t, n) {
|
|
7
|
+
e instanceof Float64Array && (e = new BigInt64Array(e.buffer, e.byteOffset, e.length)), Atomics.store(e, t, o(n));
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
9
|
+
function a(e) {
|
|
10
|
+
return n[0] = e, t[0];
|
|
10
11
|
}
|
|
11
|
-
function o(
|
|
12
|
-
|
|
12
|
+
function o(e) {
|
|
13
|
+
return t[0] = e, n[0];
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
15
|
+
function s(e, t, n) {
|
|
16
|
+
return e instanceof Float64Array && (e = new BigInt64Array(e.buffer, e.byteOffset, e.length)), a(Atomics.exchange(e, t, o(n)));
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
18
|
+
function c(e, t, n, r) {
|
|
19
|
+
return e instanceof Float64Array && (e = new BigInt64Array(e.buffer, e.byteOffset, e.length)), a(Atomics.compareExchange(e, t, o(n), o(r)));
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
y as exchangeFloat64,
|
|
25
|
-
s as loadFloat64,
|
|
26
|
-
u as storeFloat64
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=float64-atomics.js.map
|
|
21
|
+
//#endregion
|
|
22
|
+
export { c as compareExchangeFloat64, o as convertFloat64ToInt64, a as convertInt64ToFloat64, s as exchangeFloat64, r as loadFloat64, i as storeFloat64 };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=float64-atomics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"float64-atomics.js","sources":["../../src/utils/float64-atomics.ts"],"sourcesContent":["// For doing Atomic operations on floats in SharedArrayBuffers\nconst buffer = new ArrayBuffer(8);\nconst float64 = new Float64Array(buffer);\nconst int64 = new BigInt64Array(buffer);\n\nexport function loadFloat64(data: BigInt64Array | Float64Array, index: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.load(data, index));\n}\nexport function storeFloat64(data: BigInt64Array | Float64Array, index: number, value: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\tAtomics.store(data, index, convertFloat64ToInt64(value));\n}\n\nexport function convertInt64ToFloat64(value: bigint) {\n\tint64[0] = value;\n\n\treturn float64[0];\n}\nexport function convertFloat64ToInt64(value: number) {\n\tfloat64[0] = value;\n\n\treturn int64[0];\n}\n\nexport function exchangeFloat64(data: BigInt64Array | Float64Array, index: number, value: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.exchange(data, index, convertFloat64ToInt64(value)));\n}\n\nexport function compareExchangeFloat64(data: BigInt64Array | Float64Array, index: number, expectedValue: number, replacementValue: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.compareExchange(data, index, convertFloat64ToInt64(expectedValue), convertFloat64ToInt64(replacementValue)));\n}"],"
|
|
1
|
+
{"version":3,"file":"float64-atomics.js","names":[],"sources":["../../src/utils/float64-atomics.ts"],"sourcesContent":["// For doing Atomic operations on floats in SharedArrayBuffers\nconst buffer = new ArrayBuffer(8);\nconst float64 = new Float64Array(buffer);\nconst int64 = new BigInt64Array(buffer);\n\nexport function loadFloat64(data: BigInt64Array | Float64Array, index: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.load(data, index));\n}\nexport function storeFloat64(data: BigInt64Array | Float64Array, index: number, value: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\tAtomics.store(data, index, convertFloat64ToInt64(value));\n}\n\nexport function convertInt64ToFloat64(value: bigint) {\n\tint64[0] = value;\n\n\treturn float64[0];\n}\nexport function convertFloat64ToInt64(value: number) {\n\tfloat64[0] = value;\n\n\treturn int64[0];\n}\n\nexport function exchangeFloat64(data: BigInt64Array | Float64Array, index: number, value: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.exchange(data, index, convertFloat64ToInt64(value)));\n}\n\nexport function compareExchangeFloat64(data: BigInt64Array | Float64Array, index: number, expectedValue: number, replacementValue: number) {\n\tif(data instanceof Float64Array) {\n\t\tdata = new BigInt64Array(data.buffer, data.byteOffset, data.length);\n\t}\n\n\treturn convertInt64ToFloat64(Atomics.compareExchange(data, index, convertFloat64ToInt64(expectedValue), convertFloat64ToInt64(replacementValue)));\n}"],"mappings":";AACA,IAAM,oBAAS,IAAI,YAAY,CAAC,GAC1B,IAAU,IAAI,aAAa,CAAM,GACjC,IAAQ,IAAI,cAAc,CAAM;AAEtC,SAAgB,EAAY,GAAoC,GAAe;CAK9E,OAJG,aAAgB,iBAClB,IAAO,IAAI,cAAc,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAG5D,EAAsB,QAAQ,KAAK,GAAM,CAAK,CAAC;AACvD;AACA,SAAgB,EAAa,GAAoC,GAAe,GAAe;CAK9F,AAJG,aAAgB,iBAClB,IAAO,IAAI,cAAc,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAGnE,QAAQ,MAAM,GAAM,GAAO,EAAsB,CAAK,CAAC;AACxD;AAEA,SAAgB,EAAsB,GAAe;CAGpD,OAFA,EAAM,KAAK,GAEJ,EAAQ;AAChB;AACA,SAAgB,EAAsB,GAAe;CAGpD,OAFA,EAAQ,KAAK,GAEN,EAAM;AACd;AAEA,SAAgB,EAAgB,GAAoC,GAAe,GAAe;CAKjG,OAJG,aAAgB,iBAClB,IAAO,IAAI,cAAc,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAG5D,EAAsB,QAAQ,SAAS,GAAM,GAAO,EAAsB,CAAK,CAAC,CAAC;AACzF;AAEA,SAAgB,EAAuB,GAAoC,GAAe,GAAuB,GAA0B;CAK1I,OAJG,aAAgB,iBAClB,IAAO,IAAI,cAAc,EAAK,QAAQ,EAAK,YAAY,EAAK,MAAM,IAG5D,EAAsB,QAAQ,gBAAgB,GAAM,GAAO,EAAsB,CAAa,GAAG,EAAsB,CAAgB,CAAC,CAAC;AACjJ"}
|
package/dist/utils/pointer.js
CHANGED
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
r as createPointer,
|
|
36
|
-
O as getPointer,
|
|
37
|
-
u as loadPointer,
|
|
38
|
-
f as loadRawPointer,
|
|
39
|
-
B as replacePointer,
|
|
40
|
-
E as replaceRawPointer,
|
|
41
|
-
N as storePointer,
|
|
42
|
-
P as storeRawPointer
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=pointer.js.map
|
|
1
|
+
//#region src/utils/pointer.ts
|
|
2
|
+
var e = 20, t = 12, n = 2 ** 20, r = 4096;
|
|
3
|
+
function i(e, t = 0) {
|
|
4
|
+
return u(Atomics.load(e, t));
|
|
5
|
+
}
|
|
6
|
+
function a(e, t = 0) {
|
|
7
|
+
return Atomics.load(e, t);
|
|
8
|
+
}
|
|
9
|
+
function o(e, t = 0, n, r) {
|
|
10
|
+
Atomics.store(e, t, d(n, r));
|
|
11
|
+
}
|
|
12
|
+
function s(e, t = 0, n) {
|
|
13
|
+
Atomics.store(e, t, n);
|
|
14
|
+
}
|
|
15
|
+
function c(e, t, n, r, i, a) {
|
|
16
|
+
let o = d(i, a);
|
|
17
|
+
return Atomics.compareExchange(e, t, o, d(n, r)) === o;
|
|
18
|
+
}
|
|
19
|
+
function l(e, t, n, r) {
|
|
20
|
+
return Atomics.compareExchange(e, t, r, n) === r;
|
|
21
|
+
}
|
|
22
|
+
function u(e) {
|
|
23
|
+
return {
|
|
24
|
+
bufferPosition: e & 4095,
|
|
25
|
+
bufferByteOffset: e >>> 12
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function d(e, t) {
|
|
29
|
+
return e + (t << 12);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { e as BYTE_OFFSET_BIT_COUNT, n as MAX_BYTE_OFFSET_LENGTH, r as MAX_POSITION_LENGTH, t as POSITION_BIT_COUNT, d as createPointer, u as getPointer, i as loadPointer, a as loadRawPointer, c as replacePointer, l as replaceRawPointer, o as storePointer, s as storeRawPointer };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=pointer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointer.js","sources":["../../src/utils/pointer.ts"],"sourcesContent":["// bottom 12 bits (4096) for bufferPosition\n// top 20 bits (1MB) for bufferByteOffset\nconst BYTE_OFFSET_BIT_COUNT = 20;\nconst POSITION_BIT_COUNT = 32 - BYTE_OFFSET_BIT_COUNT;\nconst MAX_BYTE_OFFSET_LENGTH = Math.pow(2, BYTE_OFFSET_BIT_COUNT);\nconst MAX_POSITION_LENGTH = Math.pow(2, POSITION_BIT_COUNT);\n\nexport function loadPointer(data: Uint32Array, index: number = 0) {\n\treturn getPointer(Atomics.load(data, index));\n}\nexport function loadRawPointer(data: Uint32Array, index: number = 0) {\n\treturn Atomics.load(data, index);\n}\n\nexport function storePointer(data: Uint32Array, index: number = 0, bufferPosition: number, bufferByteOffset: number) {\n\tAtomics.store(data, index, createPointer(bufferPosition, bufferByteOffset));\n}\nexport function storeRawPointer(data: Uint32Array, index: number = 0, pointer: number) {\n\tAtomics.store(data, index, pointer);\n}\n\nexport function replacePointer(data: Uint32Array, index: number, newBufferPosition: number, newBufferByteOffset: number, oldBufferPosition: number, oldBufferByteOffset: number) {\n\tlet oldPointer = createPointer(oldBufferPosition, oldBufferByteOffset);\n\treturn Atomics.compareExchange(data, index, oldPointer, createPointer(newBufferPosition, newBufferByteOffset)) === oldPointer;\n}\nexport function replaceRawPointer(data: Uint32Array, index: number, newPointer: number, oldPointer: number): boolean {\n\treturn Atomics.compareExchange(data, index, oldPointer, newPointer) === oldPointer;\n}\n\nexport function getPointer(value: number) {\n\treturn {\n\t\tbufferPosition: value & 0b00000000000000000000111111111111,\n\t\tbufferByteOffset: value >>> POSITION_BIT_COUNT
|
|
1
|
+
{"version":3,"file":"pointer.js","names":[],"sources":["../../src/utils/pointer.ts"],"sourcesContent":["// bottom 12 bits (4096) for bufferPosition\n// top 20 bits (1MB) for bufferByteOffset\nconst BYTE_OFFSET_BIT_COUNT = 20;\nconst POSITION_BIT_COUNT = 32 - BYTE_OFFSET_BIT_COUNT;\nconst MAX_BYTE_OFFSET_LENGTH = Math.pow(2, BYTE_OFFSET_BIT_COUNT);\nconst MAX_POSITION_LENGTH = Math.pow(2, POSITION_BIT_COUNT);\n\nexport function loadPointer(data: Uint32Array, index: number = 0) {\n\treturn getPointer(Atomics.load(data, index));\n}\nexport function loadRawPointer(data: Uint32Array, index: number = 0) {\n\treturn Atomics.load(data, index);\n}\n\nexport function storePointer(data: Uint32Array, index: number = 0, bufferPosition: number, bufferByteOffset: number) {\n\tAtomics.store(data, index, createPointer(bufferPosition, bufferByteOffset));\n}\nexport function storeRawPointer(data: Uint32Array, index: number = 0, pointer: number) {\n\tAtomics.store(data, index, pointer);\n}\n\nexport function replacePointer(data: Uint32Array, index: number, newBufferPosition: number, newBufferByteOffset: number, oldBufferPosition: number, oldBufferByteOffset: number) {\n\tlet oldPointer = createPointer(oldBufferPosition, oldBufferByteOffset);\n\treturn Atomics.compareExchange(data, index, oldPointer, createPointer(newBufferPosition, newBufferByteOffset)) === oldPointer;\n}\nexport function replaceRawPointer(data: Uint32Array, index: number, newPointer: number, oldPointer: number): boolean {\n\treturn Atomics.compareExchange(data, index, oldPointer, newPointer) === oldPointer;\n}\n\nexport function getPointer(value: number) {\n\treturn {\n\t\tbufferPosition: value & 0b00000000000000000000111111111111,\n\t\tbufferByteOffset: value >>> POSITION_BIT_COUNT,\n\t};\n}\nexport function createPointer(bufferPosition: number, bufferByteOffset: number) {\n\treturn bufferPosition + (bufferByteOffset << POSITION_BIT_COUNT);\n}\n\nexport { BYTE_OFFSET_BIT_COUNT, POSITION_BIT_COUNT, MAX_BYTE_OFFSET_LENGTH, MAX_POSITION_LENGTH };"],"mappings":";AAEA,IAAM,IAAwB,IACxB,IAAqB,IACrB,IAAkC,KAAA,IAClC,IAAsB;AAE5B,SAAgB,EAAY,GAAmB,IAAgB,GAAG;CACjE,OAAO,EAAW,QAAQ,KAAK,GAAM,CAAK,CAAC;AAC5C;AACA,SAAgB,EAAe,GAAmB,IAAgB,GAAG;CACpE,OAAO,QAAQ,KAAK,GAAM,CAAK;AAChC;AAEA,SAAgB,EAAa,GAAmB,IAAgB,GAAG,GAAwB,GAA0B;CACpH,QAAQ,MAAM,GAAM,GAAO,EAAc,GAAgB,CAAgB,CAAC;AAC3E;AACA,SAAgB,EAAgB,GAAmB,IAAgB,GAAG,GAAiB;CACtF,QAAQ,MAAM,GAAM,GAAO,CAAO;AACnC;AAEA,SAAgB,EAAe,GAAmB,GAAe,GAA2B,GAA6B,GAA2B,GAA6B;CAChL,IAAI,IAAa,EAAc,GAAmB,CAAmB;CACrE,OAAO,QAAQ,gBAAgB,GAAM,GAAO,GAAY,EAAc,GAAmB,CAAmB,CAAC,MAAM;AACpH;AACA,SAAgB,EAAkB,GAAmB,GAAe,GAAoB,GAA6B;CACpH,OAAO,QAAQ,gBAAgB,GAAM,GAAO,GAAY,CAAU,MAAM;AACzE;AAEA,SAAgB,EAAW,GAAe;CACzC,OAAO;EACN,gBAAgB,IAAQ;EACxB,kBAAkB,MAAA;CACnB;AACD;AACA,SAAgB,EAAc,GAAwB,GAA0B;CAC/E,OAAO,KAAkB,KAAA;AAC1B"}
|
|
@@ -29,13 +29,13 @@ export type FloatType = 'f32' | 'f64';
|
|
|
29
29
|
* {@link TYPE2GL}
|
|
30
30
|
*/
|
|
31
31
|
export declare enum GLType {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
I8 = 5120,
|
|
33
|
+
U8 = 5121,
|
|
34
|
+
I16 = 5122,
|
|
35
|
+
U16 = 5123,
|
|
36
|
+
I32 = 5124,
|
|
37
|
+
U32 = 5125,
|
|
38
|
+
F32 = 5126,
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Conversion from {@link GLType} to {@link Type} enums.
|
|
@@ -55,34 +55,34 @@ export declare const TYPE2GL: Record<Type, GLType | undefined>;
|
|
|
55
55
|
* {@link sizeOf}.
|
|
56
56
|
*/
|
|
57
57
|
export declare const SIZEOF: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
u8: number
|
|
59
|
+
u8c: number
|
|
60
|
+
i8: number
|
|
61
|
+
u16: number
|
|
62
|
+
i16: number
|
|
63
|
+
u32: number
|
|
64
|
+
i32: number
|
|
65
|
+
i64: number
|
|
66
|
+
u64: number
|
|
67
|
+
f32: number
|
|
68
|
+
f64: number
|
|
69
69
|
};
|
|
70
70
|
/**
|
|
71
71
|
* Bit shift values to convert byte addresses into array indices for all
|
|
72
72
|
* {@link Type}s and {@link BigType}s.
|
|
73
73
|
*/
|
|
74
74
|
export declare const BIT_SHIFTS: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
i8: number
|
|
76
|
+
u8: number
|
|
77
|
+
u8c: number
|
|
78
|
+
i16: number
|
|
79
|
+
u16: number
|
|
80
|
+
i32: number
|
|
81
|
+
u32: number
|
|
82
|
+
i64: number
|
|
83
|
+
u64: number
|
|
84
|
+
f32: number
|
|
85
|
+
f64: number
|
|
86
86
|
};
|
|
87
87
|
export declare const FLOAT_ARRAY_CTORS: Record<FloatType, FloatArrayConstructor>;
|
|
88
88
|
export declare const INT_ARRAY_CTORS: Record<IntType, IntArrayConstructor>;
|
|
@@ -90,26 +90,26 @@ export declare const UINT_ARRAY_CTORS: Record<UintType, UIntArrayConstructor>;
|
|
|
90
90
|
export declare const BIGINT_ARRAY_CTORS: Record<BigType, BigIntArrayConstructor>;
|
|
91
91
|
export declare const TYPEDARRAY_CTORS: Record<Type, TypedArrayConstructor>;
|
|
92
92
|
export interface TypedArrayTypeMap extends Record<Type | GLType, TypedArray> {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
u8: Uint8Array
|
|
94
|
+
u8c: Uint8ClampedArray
|
|
95
|
+
i8: Int8Array
|
|
96
|
+
u16: Uint16Array
|
|
97
|
+
i16: Int16Array
|
|
98
|
+
u32: Uint32Array
|
|
99
|
+
i32: Int32Array
|
|
100
|
+
f32: Float32Array
|
|
101
|
+
f64: Float64Array
|
|
102
|
+
[GLType.U8]: Uint8Array
|
|
103
|
+
[GLType.I8]: Int8Array
|
|
104
|
+
[GLType.U16]: Uint16Array
|
|
105
|
+
[GLType.I16]: Int16Array
|
|
106
|
+
[GLType.U32]: Uint32Array
|
|
107
|
+
[GLType.I32]: Int32Array
|
|
108
|
+
[GLType.F32]: Float32Array
|
|
109
109
|
}
|
|
110
110
|
export interface BigTypedArrayTypeMap extends Record<BigType, BigTypedArray> {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
i64: BigInt64Array
|
|
112
|
+
u64: BigUint64Array
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Returns canonical {@link Type} value of `type` by first
|
package/dist/utils/typedarray.js
CHANGED
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
//#region src/utils/typedarray.js
|
|
2
|
+
var e = {
|
|
3
|
+
5120: "i8",
|
|
4
|
+
5121: "u8",
|
|
5
|
+
5122: "i16",
|
|
6
|
+
5123: "u16",
|
|
7
|
+
5124: "i32",
|
|
8
|
+
5125: "u32",
|
|
9
|
+
5126: "f32"
|
|
10
|
+
}, t = {
|
|
11
|
+
f32: Float32Array,
|
|
12
|
+
f64: Float64Array
|
|
13
|
+
}, n = {
|
|
14
|
+
i8: Int8Array,
|
|
15
|
+
i16: Int16Array,
|
|
16
|
+
i32: Int32Array
|
|
17
|
+
}, r = {
|
|
18
|
+
u8: Uint8Array,
|
|
19
|
+
u8c: Uint8ClampedArray,
|
|
20
|
+
u16: Uint16Array,
|
|
21
|
+
u32: Uint32Array
|
|
12
22
|
}, i = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
i64: BigInt64Array,
|
|
23
|
-
u64: BigUint64Array
|
|
24
|
-
}, c = {
|
|
25
|
-
...a,
|
|
26
|
-
...i,
|
|
27
|
-
...o
|
|
28
|
-
}, y = (r) => {
|
|
29
|
-
const t = A[r];
|
|
30
|
-
return t !== void 0 ? t : r;
|
|
23
|
+
i64: BigInt64Array,
|
|
24
|
+
u64: BigUint64Array
|
|
25
|
+
}, a = {
|
|
26
|
+
...t,
|
|
27
|
+
...n,
|
|
28
|
+
...r
|
|
29
|
+
}, o = (t) => {
|
|
30
|
+
let n = e[t];
|
|
31
|
+
return n === void 0 ? t : n;
|
|
31
32
|
};
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
return new (n || c[y(r)])(...t);
|
|
33
|
+
function s(e, ...t) {
|
|
34
|
+
return new (i[e] || a[o(e)])(...t);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
i as INT_ARRAY_CTORS,
|
|
41
|
-
c as TYPEDARRAY_CTORS,
|
|
42
|
-
o as UINT_ARRAY_CTORS,
|
|
43
|
-
y as asNativeType,
|
|
44
|
-
T as typedArray
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=typedarray.js.map
|
|
36
|
+
//#endregion
|
|
37
|
+
export { i as BIGINT_ARRAY_CTORS, t as FLOAT_ARRAY_CTORS, e as GL2TYPE, n as INT_ARRAY_CTORS, a as TYPEDARRAY_CTORS, r as UINT_ARRAY_CTORS, o as asNativeType, s as typedArray };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=typedarray.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedarray.js","sources":["../../src/utils/typedarray.js"],"sourcesContent":["// Copied from @thi.ng/api/typedarray\n// TODO: rewrite without this but for now just forked in order to add Atomics to base library\n\nvar GLType = /* @__PURE__ */ ((GLType2) => {\n\tGLType2[GLType2['I8'] = 5120] = 'I8';\n\tGLType2[GLType2['U8'] = 5121] = 'U8';\n\tGLType2[GLType2['I16'] = 5122] = 'I16';\n\tGLType2[GLType2['U16'] = 5123] = 'U16';\n\tGLType2[GLType2['I32'] = 5124] = 'I32';\n\tGLType2[GLType2['U32'] = 5125] = 'U32';\n\tGLType2[GLType2['F32'] = 5126] = 'F32';\n\treturn GLType2;\n})(GLType || {});\nconst GL2TYPE = {\n\t[5120 /* I8 */]: 'i8',\n\t[5121 /* U8 */]: 'u8',\n\t[5122 /* I16 */]: 'i16',\n\t[5123 /* U16 */]: 'u16',\n\t[5124 /* I32 */]: 'i32',\n\t[5125 /* U32 */]: 'u32',\n\t[5126 /* F32 */]: 'f32'
|
|
1
|
+
{"version":3,"file":"typedarray.js","names":[],"sources":["../../src/utils/typedarray.js"],"sourcesContent":["// Copied from @thi.ng/api/typedarray\n// TODO: rewrite without this but for now just forked in order to add Atomics to base library\n\nvar GLType = /* @__PURE__ */ ((GLType2) => {\n\tGLType2[GLType2['I8'] = 5120] = 'I8';\n\tGLType2[GLType2['U8'] = 5121] = 'U8';\n\tGLType2[GLType2['I16'] = 5122] = 'I16';\n\tGLType2[GLType2['U16'] = 5123] = 'U16';\n\tGLType2[GLType2['I32'] = 5124] = 'I32';\n\tGLType2[GLType2['U32'] = 5125] = 'U32';\n\tGLType2[GLType2['F32'] = 5126] = 'F32';\n\treturn GLType2;\n})(GLType || {});\nconst GL2TYPE = {\n\t[5120 /* I8 */]: 'i8',\n\t[5121 /* U8 */]: 'u8',\n\t[5122 /* I16 */]: 'i16',\n\t[5123 /* U16 */]: 'u16',\n\t[5124 /* I32 */]: 'i32',\n\t[5125 /* U32 */]: 'u32',\n\t[5126 /* F32 */]: 'f32',\n};\nconst TYPE2GL = {\n\ti8: 5120 /* I8 */,\n\tu8: 5121 /* U8 */,\n\tu8c: 5121 /* U8 */,\n\ti16: 5122 /* I16 */,\n\tu16: 5123 /* U16 */,\n\ti32: 5124 /* I32 */,\n\tu32: 5125 /* U32 */,\n\tf32: 5126 /* F32 */,\n\tf64: void 0,\n};\nconst SIZEOF = {\n\tu8: 1,\n\tu8c: 1,\n\ti8: 1,\n\tu16: 2,\n\ti16: 2,\n\tu32: 4,\n\ti32: 4,\n\ti64: 8,\n\tu64: 8,\n\tf32: 4,\n\tf64: 8,\n};\nconst BIT_SHIFTS = {\n\ti8: 0,\n\tu8: 0,\n\tu8c: 0,\n\ti16: 1,\n\tu16: 1,\n\ti32: 2,\n\tu32: 2,\n\ti64: 3,\n\tu64: 3,\n\tf32: 2,\n\tf64: 3,\n};\nconst FLOAT_ARRAY_CTORS = {\n\tf32: Float32Array,\n\tf64: Float64Array,\n};\nconst INT_ARRAY_CTORS = {\n\ti8: Int8Array,\n\ti16: Int16Array,\n\ti32: Int32Array,\n};\nconst UINT_ARRAY_CTORS = {\n\tu8: Uint8Array,\n\tu8c: Uint8ClampedArray,\n\tu16: Uint16Array,\n\tu32: Uint32Array,\n};\nconst BIGINT_ARRAY_CTORS = {\n\ti64: BigInt64Array,\n\tu64: BigUint64Array,\n};\nconst TYPEDARRAY_CTORS = {\n\t...FLOAT_ARRAY_CTORS,\n\t...INT_ARRAY_CTORS,\n\t...UINT_ARRAY_CTORS,\n};\nconst asNativeType = (type) => {\n\tconst t = GL2TYPE[type];\n\treturn t !== void 0 ? t : type;\n};\nconst asGLType = (type) => {\n\tconst t = TYPE2GL[type];\n\treturn t !== void 0 ? t : type;\n};\nconst asInt = (...args) => args.map((x) => x | 0);\nconst sizeOf = (type) => SIZEOF[type] || SIZEOF[asNativeType(type)];\nfunction typedArray(type, ...xs) {\n\tconst ctor = BIGINT_ARRAY_CTORS[type];\n\treturn new (ctor || TYPEDARRAY_CTORS[asNativeType(type)])(...xs);\n}\nfunction typedArrayOfVec(type, data, stride) {\n\tconst $data = Array.isArray(data) ? data : [...data];\n\tif(stride === void 0)\n\t\tstride = $data[0].length;\n\tconst num = $data.length;\n\tconst res = typedArray(type, num * stride);\n\tfor(let i = 0, j = 0; i < num; i++, j += stride) {\n\t\tres.set($data[i], j);\n\t}\n\treturn res;\n}\nconst typedArrayType = (x) => {\n\tif(Array.isArray(x))\n\t\treturn 'f64';\n\tfor(let id in TYPEDARRAY_CTORS) {\n\t\tif(x instanceof TYPEDARRAY_CTORS[id])\n\t\t\treturn id;\n\t}\n\treturn 'f64';\n};\nconst uintTypeForSize = (x) => x <= 256 ? 'u8' : x <= 65536 ? 'u16' : 'u32';\nconst intTypeForSize = (x) => x >= -128 && x < 128 ? 'i8' : x >= -32768 && x < 32768 ? 'i16' : 'i32';\nconst uintTypeForBits = (x) => x > 16 ? 'u32' : x > 8 ? 'u16' : 'u8';\nconst intTypeForBits = (x) => x > 16 ? 'i32' : x > 8 ? 'i16' : 'i8';\nconst narrowInt = (t) => t === 'i64' ? 'i32' : t === 'i32' ? 'i16' : t === 'i16' ? 'i8' : 'i8';\nconst widenInt = (t) => t === 'i8' ? 'i16' : t === 'i16' ? 'i32' : t === 'i32' ? 'i64' : 'i64';\nconst narrowUint = (t) => t === 'u64' ? 'u32' : t === 'u32' ? 'u16' : t === 'u16' ? 'u8' : 'u8';\nconst widenUint = (t) => t === 'u8' || t === 'u8c' ? 'u16' : t === 'u16' ? 'u32' : t === 'u32' ? 'u64' : 'u64';\nconst narrowFloat = (t) => t === 'f64' ? 'f32' : 'f32';\nconst widenFloat = (t) => t === 'f32' ? 'f64' : 'f64';\nconst narrowType = (t) => t[0] === 'i' ? narrowInt(t) : t[0] === 'u' ? narrowUint(t) : narrowFloat(t);\nconst widenType = (t) => t[0] === 'i' ? widenInt(t) : t[0] === 'u' ? widenUint(t) : widenFloat(t);\nexport {\n\tBIGINT_ARRAY_CTORS,\n\tBIT_SHIFTS,\n\tFLOAT_ARRAY_CTORS,\n\tGL2TYPE,\n\tGLType,\n\tINT_ARRAY_CTORS,\n\tSIZEOF,\n\tTYPE2GL,\n\tTYPEDARRAY_CTORS,\n\tUINT_ARRAY_CTORS,\n\tasGLType,\n\tasInt,\n\tasNativeType,\n\tintTypeForBits,\n\tintTypeForSize,\n\tnarrowFloat,\n\tnarrowInt,\n\tnarrowType,\n\tnarrowUint,\n\tsizeOf,\n\ttypedArray,\n\ttypedArrayOfVec,\n\ttypedArrayType,\n\tuintTypeForBits,\n\tuintTypeForSize,\n\twidenFloat,\n\twidenInt,\n\twidenType,\n\twidenUint,\n};\n"],"mappings":";AAaA,IAAM,IAAU;CACd,MAAgB;CAChB,MAAgB;CAChB,MAAiB;CACjB,MAAiB;CACjB,MAAiB;CACjB,MAAiB;CACjB,MAAiB;AACnB,GAsCM,IAAoB;CACzB,KAAK;CACL,KAAK;AACN,GACM,IAAkB;CACvB,IAAI;CACJ,KAAK;CACL,KAAK;AACN,GACM,IAAmB;CACxB,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;AACN,GACM,IAAqB;CAC1B,KAAK;CACL,KAAK;AACN,GACM,IAAmB;CACxB,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GACM,KAAgB,MAAS;CAC9B,IAAM,IAAI,EAAQ;CAClB,OAAO,MAAM,KAAK,IAAQ,IAAJ;AACvB;AAOA,SAAS,EAAW,GAAM,GAAG,GAAI;CAEhC,OAAO,KADM,EAAmB,MACZ,EAAiB,EAAa,CAAI,IAAI,GAAG,CAAE;AAChE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daneren2005/shared-memory-objects",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "daneren2005@gmail.com",
|
|
5
5
|
"description": "Creating objects with a SharedArrayBuffer",
|
|
6
6
|
"homepage": "https://github.com/daneren2005/shared-memory-objects#readme",
|
|
@@ -23,43 +23,43 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
"./*": {
|
|
25
25
|
"import": {
|
|
26
|
-
"types": "./dist
|
|
26
|
+
"types": "./dist/*.d.ts",
|
|
27
27
|
"default": "./dist/*.js"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "vite build",
|
|
32
|
+
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/copy-vendored-types.mjs",
|
|
33
33
|
"dev": "vite",
|
|
34
|
-
"lint": "
|
|
35
|
-
"lint:fix": "
|
|
34
|
+
"lint": "cross-env NODE_ENV=production oxlint .",
|
|
35
|
+
"lint:fix": "cross-env NODE_ENV=production oxlint --fix .",
|
|
36
36
|
"preview": "vite preview",
|
|
37
37
|
"publish:manual": "npm publish --access public",
|
|
38
38
|
"release": "semantic-release",
|
|
39
39
|
"start": "npm run dev",
|
|
40
|
-
"test:bench": "vitest bench",
|
|
40
|
+
"test:bench": "vitest bench --run",
|
|
41
|
+
"test:bench:watch": "vitest bench",
|
|
41
42
|
"test:ui": "vitest --ui --api 9527",
|
|
42
43
|
"test:unit": "vitest run",
|
|
43
44
|
"test:unit:watch": "vitest",
|
|
44
|
-
"type-check": "tsc --
|
|
45
|
+
"type-check": "tsc --noEmit",
|
|
45
46
|
"prepare": "husky"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@semantic-release/git": "^
|
|
49
|
-
"@
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"@vitest/coverage-v8": "^4.
|
|
52
|
-
"@vitest/
|
|
53
|
-
"
|
|
54
|
-
"eslint": "^9.38.0",
|
|
49
|
+
"@semantic-release/git": "^11.0.1",
|
|
50
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
51
|
+
"@types/node": "^26.2.0",
|
|
52
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
53
|
+
"@vitest/ui": "^4.1.10",
|
|
54
|
+
"cross-env": "^10.1.0",
|
|
55
55
|
"husky": "^9.1.7",
|
|
56
|
-
"lint-staged": "^
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"vite": "^
|
|
63
|
-
"vitest": "^4.
|
|
56
|
+
"lint-staged": "^17.3.0",
|
|
57
|
+
"oxlint": "^1.78.0",
|
|
58
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
59
|
+
"pretty-bytes": "^7.1.1",
|
|
60
|
+
"semantic-release": "^25.0.9",
|
|
61
|
+
"typescript": "^7.0.2",
|
|
62
|
+
"vite": "^8.2.1",
|
|
63
|
+
"vitest": "^4.1.10"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pow2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-array-constructor.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-array.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|