@bnaya/objectbuffer
Advanced tools
Comparing version 0.0.0-4dc8259 to 0.0.0-50e77f5
@@ -50,3 +50,2 @@ import { getOurPointerIfApplicable, strByteLength } from "./utils"; | ||
continue; | ||
break; | ||
@@ -62,3 +61,2 @@ case "string": | ||
continue; | ||
break; | ||
@@ -75,3 +73,2 @@ case "bigint": | ||
continue; | ||
break; | ||
@@ -82,3 +79,2 @@ case "function": | ||
continue; | ||
break; | ||
@@ -89,13 +85,8 @@ case "symbol": | ||
continue; | ||
break; | ||
// we will never get here | ||
case "undefined": | ||
continue; | ||
break; | ||
// we will never get here | ||
case "boolean": | ||
continue; | ||
break; | ||
// // we will never get here | ||
// case "undefined": | ||
// continue; | ||
// // we will never get here | ||
// case "boolean": | ||
// continue; | ||
} | ||
@@ -102,0 +93,0 @@ |
@@ -574,6 +574,2 @@ Object.defineProperty(exports, "__esModule", { | ||
continue; | ||
case "undefined": | ||
case "boolean": | ||
continue; | ||
} | ||
@@ -580,0 +576,0 @@ const f = c(n, r.allocator); |
@@ -570,6 +570,2 @@ const t = Symbol("INTERNAL_API"), r = 0 + Uint32Array.BYTES_PER_ELEMENT, e = r + Uint32Array.BYTES_PER_ELEMENT, n = e + Uint32Array.BYTES_PER_ELEMENT, i = BigInt("0xFFFFFFFFFFFFFFFF"), o = [ "string", "number", "bigint", "boolean", "undefined" ]; | ||
continue; | ||
case "undefined": | ||
case "boolean": | ||
continue; | ||
} | ||
@@ -576,0 +572,0 @@ const f = c(n, r.allocator); |
{ | ||
"name": "@bnaya/objectbuffer", | ||
"description": "Object-like api, backed by an array buffer", | ||
"version": "0.0.0-4dc8259", | ||
"version": "0.0.0-50e77f5", | ||
"main": "dist/objectbuffer.cjs.js", | ||
@@ -6,0 +6,0 @@ "module": "dist/index.js", |
@@ -7,4 +7,4 @@ /* eslint-env jest */ | ||
describe("object tests", () => { | ||
test("Basic object with values", () => { | ||
describe("bigint tests", () => { | ||
test("ok bigint", () => { | ||
const ob = createObjectBuffer<any>({}, 512, {}); | ||
@@ -32,2 +32,26 @@ expect(memoryStats(ob).used).toMatchInlineSnapshot(`160`); | ||
}); | ||
test("bad bigint", () => { | ||
const ob = createObjectBuffer<any>({}, 512, {}); | ||
expect(memoryStats(ob).used).toMatchInlineSnapshot(`160`); | ||
ob.bigintNegative = undefined; | ||
ob.bigintPositive = undefined; | ||
expect(memoryStats(ob).used).toMatchInlineSnapshot(`336`); | ||
ob.bigintNegative = (MAX_64_BIG_INT + BigInt("1")) * BigInt("-1"); | ||
ob.bigintPositive = MAX_64_BIG_INT + BigInt("1"); | ||
ob.bigintPositive = undefined; | ||
ob.bigintPositive = MAX_64_BIG_INT + BigInt("1"); | ||
expect(memoryStats(ob).used).toMatchInlineSnapshot(`336`); | ||
expect(ob).toMatchInlineSnapshot(` | ||
Object { | ||
"bigintNegative": undefined, | ||
"bigintPositive": undefined, | ||
} | ||
`); | ||
}); | ||
}); |
@@ -91,3 +91,2 @@ import { getOurPointerIfApplicable, strByteLength } from "./utils"; | ||
continue; | ||
break; | ||
@@ -113,3 +112,2 @@ case "string": | ||
continue; | ||
break; | ||
@@ -139,3 +137,2 @@ case "bigint": | ||
continue; | ||
break; | ||
@@ -148,3 +145,2 @@ case "function": | ||
continue; | ||
break; | ||
@@ -157,12 +153,9 @@ case "symbol": | ||
continue; | ||
break; | ||
// we will never get here | ||
case "undefined": | ||
continue; | ||
break; | ||
// we will never get here | ||
case "boolean": | ||
continue; | ||
break; | ||
// // we will never get here | ||
// case "undefined": | ||
// continue; | ||
// // we will never get here | ||
// case "boolean": | ||
// continue; | ||
} | ||
@@ -169,0 +162,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1319925
214
16768