ordered-binary 1.2.1 → 1.2.2

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/index.cjs CHANGED
@@ -20,6 +20,8 @@ control character types:
20
20
 
21
21
  const float64Array = new Float64Array(2);
22
22
  const int32Array = new Int32Array(float64Array.buffer, 0, 4);
23
+ new Uint8Array(float64Array.buffer, 2, 6);
24
+ new Uint8Array(float64Array.buffer, 0, 8);
23
25
  let nullTerminate = false;
24
26
  let textEncoder;
25
27
  try {
@@ -210,9 +212,12 @@ function readKey(buffer, start, end, inSequence) {
210
212
  }
211
213
  return value
212
214
  }
215
+ const enableNullTermination = () => nullTerminate = true;
216
+
213
217
  const encoder = {
214
218
  writeKey,
215
219
  readKey,
220
+ enableNullTermination,
216
221
  };
217
222
  const toBufferKey = (key) => {
218
223
  let buffer = Buffer.alloc(2048);
@@ -277,8 +282,6 @@ function finishUtf8(byte1, src) {
277
282
  }
278
283
  }
279
284
 
280
- const enableNullTermination = () => nullTerminate = true;
281
-
282
285
  const readString = eval(makeStringBuilder());
283
286
 
284
287
  function compareKeys(a, b) {
@@ -331,7 +334,7 @@ const typeOrder = {
331
334
  string: 4
332
335
  };
333
336
  const MINIMUM_KEY = null;
334
- const MAXIMUM_KEY = Buffer.from([0xff]);
337
+ const MAXIMUM_KEY = new Uint8Array([0xff]);
335
338
 
336
339
  exports.MAXIMUM_KEY = MAXIMUM_KEY;
337
340
  exports.MINIMUM_KEY = MINIMUM_KEY;
package/index.js CHANGED
@@ -208,9 +208,12 @@ export function readKey(buffer, start, end, inSequence) {
208
208
  }
209
209
  return value
210
210
  }
211
+ export const enableNullTermination = () => nullTerminate = true
212
+
211
213
  export const encoder = {
212
214
  writeKey,
213
215
  readKey,
216
+ enableNullTermination,
214
217
  }
215
218
  export const toBufferKey = (key) => {
216
219
  let buffer = Buffer.alloc(2048)
@@ -275,8 +278,6 @@ function finishUtf8(byte1, src) {
275
278
  }
276
279
  }
277
280
 
278
- export const enableNullTermination = () => nullTerminate = true
279
-
280
281
  const readString = eval(makeStringBuilder())
281
282
 
282
283
  export function compareKeys(a, b) {
@@ -329,4 +330,4 @@ const typeOrder = {
329
330
  string: 4
330
331
  }
331
332
  export const MINIMUM_KEY = null
332
- export const MAXIMUM_KEY = Buffer.from([0xff])
333
+ export const MAXIMUM_KEY = new Uint8Array([0xff])
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ordered-binary",
3
3
  "author": "Kris Zyp",
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "description": "Conversion of JavaScript primitives to and from Buffer with binary order matching natural primitive order",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@types/node": "latest",
32
32
  "chai": "^4",
33
- "mocha": "^8.1.3",
34
- "rollup": "^1.20.3"
33
+ "mocha": "^9.1.3",
34
+ "rollup": "^2.61.1"
35
35
  }
36
36
  }