Comparing version 2.0.0-a.2 to 2.0.0-a.3
@@ -5,4 +5,5 @@ /** | ||
* @param buffer - input that contains an encoded varint. | ||
* @param offset | ||
* @return [decoded-varint, bytes-read] | ||
*/ | ||
export declare function decode(buffer: Uint8Array): [number, number]; | ||
export declare function decode(buffer: Uint8Array, offset?: number): [number, number]; |
@@ -19,7 +19,8 @@ const MSB = 0x80; // 1000 0000 | ||
* @param buffer - input that contains an encoded varint. | ||
* @param offset | ||
* @return [decoded-varint, bytes-read] | ||
*/ | ||
export function decode(buffer) { | ||
export function decode(buffer, offset = 0) { | ||
let result = 0; | ||
let bytesRead = 0; | ||
let bytesRead = offset; | ||
let byte = 0; | ||
@@ -36,3 +37,3 @@ let shift = 0; | ||
} | ||
return [result, bytesRead]; | ||
return [result, bytesRead - offset]; | ||
} |
{ | ||
"name": "varintes", | ||
"version": "2.0.0-a.2", | ||
"version": "2.0.0-a.3", | ||
"description": "Unsigned Varint encoding and decoding, exposed as ESModule", | ||
@@ -21,3 +21,2 @@ "keywords": [ | ||
], | ||
"main": "dist/index.js", | ||
"sideEffects": false, | ||
@@ -24,0 +23,0 @@ "typesVersions": { |
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
9305
183