dataply 0.0.23 → 0.0.24-alpha.1

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/cjs/index.js CHANGED
@@ -6190,6 +6190,24 @@ function crc32(buf) {
6190
6190
  return (crc ^ -1) >>> 0;
6191
6191
  }
6192
6192
 
6193
+ // src/utils/array.ts
6194
+ function getMinMaxValue(array) {
6195
+ let i = 0;
6196
+ let min = Infinity;
6197
+ let max = -Infinity;
6198
+ let len = array.length;
6199
+ while (i < len) {
6200
+ if (array[i] < min) {
6201
+ min = array[i];
6202
+ }
6203
+ if (array[i] > max) {
6204
+ max = array[i];
6205
+ }
6206
+ i++;
6207
+ }
6208
+ return [min, max];
6209
+ }
6210
+
6193
6211
  // src/core/Row.ts
6194
6212
  var Row = class _Row {
6195
6213
  static CONSTANT = {
@@ -9127,8 +9145,7 @@ var RowTableEngine = class {
9127
9145
  for (let i = 0, len = pks.length; i < len; i++) {
9128
9146
  pkIndexMap.set(pks[i], i);
9129
9147
  }
9130
- const minPk = Math.min(...pks);
9131
- const maxPk = Math.max(...pks);
9148
+ const [minPk, maxPk] = getMinMaxValue(pks);
9132
9149
  const pkRidPairs = new Array(pks.length).fill(null);
9133
9150
  const btx = await this.getBPTreeTransaction(tx);
9134
9151
  const stream = btx.whereStream({ gte: minPk, lte: maxPk });
@@ -0,0 +1,5 @@
1
+ type SupportedNumberArray = number[] | Uint8Array | Uint16Array | Uint32Array | Float16Array | Float32Array | Float64Array;
2
+ export declare function getMinValue(array: SupportedNumberArray): number;
3
+ export declare function getMaxValue(array: SupportedNumberArray): number;
4
+ export declare function getMinMaxValue(array: SupportedNumberArray): [number, number];
5
+ export {};
@@ -3,3 +3,4 @@ export * from './bytesToNumber';
3
3
  export * from './bitwise';
4
4
  export * from './crc32';
5
5
  export * from './binarySearch';
6
+ export * from './array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataply",
3
- "version": "0.0.23",
3
+ "version": "0.0.24-alpha.1",
4
4
  "description": "A lightweight storage engine for Node.js with support for MVCC, WAL.",
5
5
  "license": "MIT",
6
6
  "author": "izure <admin@izure.org>",
@@ -49,6 +49,6 @@
49
49
  "hookall": "^2.2.0",
50
50
  "mvcc-api": "^1.3.4",
51
51
  "ryoiki": "^1.2.0",
52
- "serializable-bptree": "^8.3.1"
52
+ "serializable-bptree": "^8.3.2"
53
53
  }
54
54
  }