@protobufjs/utf8
Advanced tools
Comparing version 1.0.7 to 1.1.0
@@ -1,34 +0,24 @@ | ||
export = utf8; | ||
/** | ||
* Calculates the UTF8 byte length of a string. | ||
* @param {string} string String | ||
* @returns {number} Byte length | ||
*/ | ||
export function length(string: string): number; | ||
/** | ||
* A minimal UTF8 implementation for number arrays. | ||
* @memberof util | ||
* @namespace | ||
* Reads UTF8 bytes as a string. | ||
* @param {Uint8Array} buffer Source buffer | ||
* @param {number} start Source start | ||
* @param {number} end Source end | ||
* @returns {string} String read | ||
*/ | ||
declare namespace utf8 { | ||
export function read(buffer: Uint8Array, start: number, end: number): string; | ||
/** | ||
* Calculates the UTF8 byte length of a string. | ||
* @param {string} string String | ||
* @returns {number} Byte length | ||
*/ | ||
function length(string: string): number; | ||
/** | ||
* Reads UTF8 bytes as a string. | ||
* @param {Uint8Array} buffer Source buffer | ||
* @param {number} start Source start | ||
* @param {number} end Source end | ||
* @returns {string} String read | ||
*/ | ||
function read(buffer: Uint8Array, start: number, end: number): string; | ||
/** | ||
* Writes a string as UTF8 bytes. | ||
* @param {string} string Source string | ||
* @param {Uint8Array} buffer Destination buffer | ||
* @param {number} offset Destination offset | ||
* @returns {number} Bytes written | ||
*/ | ||
function write(string: string, buffer: Uint8Array, offset: number): number; | ||
} | ||
/** | ||
* Writes a string as UTF8 bytes. | ||
* @param {string} string Source string | ||
* @param {Uint8Array} buffer Destination buffer | ||
* @param {number} offset Destination offset | ||
* @returns {number} Bytes written | ||
*/ | ||
export function write(string: string, buffer: Uint8Array, offset: number): number; |
@@ -70,3 +70,3 @@ "use strict"; | ||
} | ||
return i ? String.fromCharCode.apply(String, chunk.slice(0, i)) : ""; | ||
return String.fromCharCode.apply(String, chunk.slice(0, i)); | ||
}; | ||
@@ -73,0 +73,0 @@ |
{ | ||
"name": "@protobufjs/utf8", | ||
"description": "A minimal UTF8 implementation for number arrays.", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>", | ||
@@ -12,3 +12,11 @@ "repository": { | ||
"main": "index.js", | ||
"types": "index.d.ts" | ||
} | ||
"types": "index.d.ts", | ||
"devDependencies": { | ||
"istanbul": "^0.4.5", | ||
"tape": "^4.6.3" | ||
}, | ||
"scripts": { | ||
"test": "tape tests/*.js", | ||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" | ||
} | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
23500
8
163
0
2
1