Socket
Socket
Sign inDemoInstall

@protobufjs/utf8

Package Overview
Dependencies
0
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.1.0

.npmignore

50

index.d.ts

@@ -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;

2

index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc