Comparing version 0.2.53 to 0.2.54
@@ -34,3 +34,7 @@ /** | ||
import * as string from './string.js' | ||
import * as error from './error.js' | ||
const errorUnexpectedEndOfArray = error.create('Unexpected end of array') | ||
const errorIntegerOutOfRange = error.create('Integer out of Range') | ||
/** | ||
@@ -241,3 +245,4 @@ * A Decoder handles the decoding of an Uint8Array. | ||
let mult = 1 | ||
while (true) { | ||
const len = decoder.arr.length | ||
while (decoder.pos < len) { | ||
const r = decoder.arr[decoder.pos++] | ||
@@ -252,5 +257,6 @@ // num = num | ((r & binary.BITS7) << len) | ||
if (num > number.MAX_SAFE_INTEGER) { | ||
throw new Error('Integer out of range!') | ||
throw errorIntegerOutOfRange | ||
} | ||
} | ||
throw errorUnexpectedEndOfArray | ||
} | ||
@@ -278,3 +284,4 @@ | ||
} | ||
while (true) { | ||
const len = decoder.arr.length | ||
while (decoder.pos < len) { | ||
r = decoder.arr[decoder.pos++] | ||
@@ -289,5 +296,6 @@ // num = num | ((r & binary.BITS7) << len) | ||
if (num > number.MAX_SAFE_INTEGER) { | ||
throw new Error('Integer out of range!') | ||
throw errorIntegerOutOfRange | ||
} | ||
} | ||
throw errorUnexpectedEndOfArray | ||
} | ||
@@ -294,0 +302,0 @@ |
@@ -6,7 +6,7 @@ export function testGolangBinaryEncodingCompatibility(): void; | ||
export function testStringDecodingPerformance(): void; | ||
export function testAnyEncodeUnknowns(tc: t.TestCase): void; | ||
export function testAnyEncodeDate(tc: t.TestCase): void; | ||
export function testEncodeMax32bitUint(tc: t.TestCase): void; | ||
export function testVarUintEncoding(tc: t.TestCase): void; | ||
export function testVarIntEncoding(tc: t.TestCase): void; | ||
export function testAnyEncodeUnknowns(_tc: t.TestCase): void; | ||
export function testAnyEncodeDate(_tc: t.TestCase): void; | ||
export function testEncodeMax32bitUint(_tc: t.TestCase): void; | ||
export function testVarUintEncoding(_tc: t.TestCase): void; | ||
export function testVarIntEncoding(_tc: t.TestCase): void; | ||
export function testRepeatVarUintEncoding(tc: t.TestCase): void; | ||
@@ -20,19 +20,20 @@ export function testRepeatVarUintEncoding53bit(tc: t.TestCase): void; | ||
export function testAnyVsJsonEncoding(tc: t.TestCase): void; | ||
export function testStringEncoding(tc: t.TestCase): void; | ||
export function testStringEncoding(_tc: t.TestCase): void; | ||
export function testRepeatStringEncoding(tc: t.TestCase): void; | ||
export function testSetMethods(tc: t.TestCase): void; | ||
export function testSetMethods(_tc: t.TestCase): void; | ||
export function testRepeatRandomWrites(tc: t.TestCase): void; | ||
export function testWriteUint8ArrayOverflow(tc: t.TestCase): void; | ||
export function testSetOnOverflow(tc: t.TestCase): void; | ||
export function testCloneDecoder(tc: t.TestCase): void; | ||
export function testWriteBinaryEncoder(tc: t.TestCase): void; | ||
export function testWriteUint8ArrayOverflow(_tc: t.TestCase): void; | ||
export function testSetOnOverflow(_tc: t.TestCase): void; | ||
export function testCloneDecoder(_tc: t.TestCase): void; | ||
export function testWriteBinaryEncoder(_tc: t.TestCase): void; | ||
export function testOverflowStringDecoding(tc: t.TestCase): void; | ||
export function testRleEncoder(tc: t.TestCase): void; | ||
export function testRleIntDiffEncoder(tc: t.TestCase): void; | ||
export function testUintOptRleEncoder(tc: t.TestCase): void; | ||
export function testIntDiffRleEncoder(tc: t.TestCase): void; | ||
export function testRleEncoder(_tc: t.TestCase): void; | ||
export function testRleIntDiffEncoder(_tc: t.TestCase): void; | ||
export function testUintOptRleEncoder(_tc: t.TestCase): void; | ||
export function testIntDiffRleEncoder(_tc: t.TestCase): void; | ||
export function testIntEncoders(tc: t.TestCase): void; | ||
export function testIntDiffEncoder(tc: t.TestCase): void; | ||
export function testIntDiffEncoder(_tc: t.TestCase): void; | ||
export function testStringDecoder(tc: t.TestCase): void; | ||
export function testLargeNumberAnyEncoding(tc: t.TestCase): void; | ||
export function testLargeNumberAnyEncoding(_tc: t.TestCase): void; | ||
export function testInvalidVarIntEncoding(_tc: t.TestCase): void; | ||
export type EncodingPair = { | ||
@@ -39,0 +40,0 @@ read: (arg0: decoding.Decoder) => any; |
@@ -6,7 +6,7 @@ export function testGolangBinaryEncodingCompatibility(): void; | ||
export function testStringDecodingPerformance(): void; | ||
export function testAnyEncodeUnknowns(tc: t.TestCase): void; | ||
export function testAnyEncodeDate(tc: t.TestCase): void; | ||
export function testEncodeMax32bitUint(tc: t.TestCase): void; | ||
export function testVarUintEncoding(tc: t.TestCase): void; | ||
export function testVarIntEncoding(tc: t.TestCase): void; | ||
export function testAnyEncodeUnknowns(_tc: t.TestCase): void; | ||
export function testAnyEncodeDate(_tc: t.TestCase): void; | ||
export function testEncodeMax32bitUint(_tc: t.TestCase): void; | ||
export function testVarUintEncoding(_tc: t.TestCase): void; | ||
export function testVarIntEncoding(_tc: t.TestCase): void; | ||
export function testRepeatVarUintEncoding(tc: t.TestCase): void; | ||
@@ -20,19 +20,20 @@ export function testRepeatVarUintEncoding53bit(tc: t.TestCase): void; | ||
export function testAnyVsJsonEncoding(tc: t.TestCase): void; | ||
export function testStringEncoding(tc: t.TestCase): void; | ||
export function testStringEncoding(_tc: t.TestCase): void; | ||
export function testRepeatStringEncoding(tc: t.TestCase): void; | ||
export function testSetMethods(tc: t.TestCase): void; | ||
export function testSetMethods(_tc: t.TestCase): void; | ||
export function testRepeatRandomWrites(tc: t.TestCase): void; | ||
export function testWriteUint8ArrayOverflow(tc: t.TestCase): void; | ||
export function testSetOnOverflow(tc: t.TestCase): void; | ||
export function testCloneDecoder(tc: t.TestCase): void; | ||
export function testWriteBinaryEncoder(tc: t.TestCase): void; | ||
export function testWriteUint8ArrayOverflow(_tc: t.TestCase): void; | ||
export function testSetOnOverflow(_tc: t.TestCase): void; | ||
export function testCloneDecoder(_tc: t.TestCase): void; | ||
export function testWriteBinaryEncoder(_tc: t.TestCase): void; | ||
export function testOverflowStringDecoding(tc: t.TestCase): void; | ||
export function testRleEncoder(tc: t.TestCase): void; | ||
export function testRleIntDiffEncoder(tc: t.TestCase): void; | ||
export function testUintOptRleEncoder(tc: t.TestCase): void; | ||
export function testIntDiffRleEncoder(tc: t.TestCase): void; | ||
export function testRleEncoder(_tc: t.TestCase): void; | ||
export function testRleIntDiffEncoder(_tc: t.TestCase): void; | ||
export function testUintOptRleEncoder(_tc: t.TestCase): void; | ||
export function testIntDiffRleEncoder(_tc: t.TestCase): void; | ||
export function testIntEncoders(tc: t.TestCase): void; | ||
export function testIntDiffEncoder(tc: t.TestCase): void; | ||
export function testIntDiffEncoder(_tc: t.TestCase): void; | ||
export function testStringDecoder(tc: t.TestCase): void; | ||
export function testLargeNumberAnyEncoding(tc: t.TestCase): void; | ||
export function testLargeNumberAnyEncoding(_tc: t.TestCase): void; | ||
export function testInvalidVarIntEncoding(_tc: t.TestCase): void; | ||
export type EncodingPair = { | ||
@@ -39,0 +40,0 @@ read: (arg0: decoding.Decoder) => any; |
{ | ||
"name": "lib0", | ||
"version": "0.2.53", | ||
"version": "0.2.54", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
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 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 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 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 not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1079049
18941