utf8-buffer
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -87,2 +87,3 @@ /* | ||
* Read a string of UTF-8 characters from a byte buffer. | ||
* Invalid characters are replaced with 'REPLACEMENT CHARACTER' (U+FFFD). | ||
* @see https://encoding.spec.whatwg.org/#the-encoding | ||
@@ -89,0 +90,0 @@ * @see https://stackoverflow.com/a/34926911 |
@@ -33,2 +33,3 @@ /* | ||
* Read a string of UTF-8 characters from a byte buffer. | ||
* Invalid characters are replaced with 'REPLACEMENT CHARACTER' (U+FFFD). | ||
* @see https://encoding.spec.whatwg.org/#the-encoding | ||
@@ -35,0 +36,0 @@ * @see https://stackoverflow.com/a/34926911 |
// Type definitions for utf8-buffer 0.0.1 | ||
// Project: https://github.com/rochars/utf8-buffer | ||
// Definitions by: Rafael S. Rocha <https://github.com/rochars> | ||
// Definitions by: Rafael da Silva Rocha <https://github.com/rochars> | ||
// Definitions: https://github.com/rochars/utf8-buffer | ||
export function unpackUTF8(buffer: Uint8Array|ArrayLike<number>, index?: number, len?: number): string; | ||
export function unpack(buffer: Uint8Array|ArrayLike<number>, index?: number, len?: number): string; | ||
export function packUTF8(str: string): ArrayLike<number>; | ||
export function pack(str: string): Uint8Array; |
@@ -36,2 +36,3 @@ /* | ||
* Read a string of UTF-8 characters from a byte buffer. | ||
* Invalid characters are replaced with 'REPLACEMENT CHARACTER' (U+FFFD). | ||
* @see https://encoding.spec.whatwg.org/#the-encoding | ||
@@ -38,0 +39,0 @@ * @see https://stackoverflow.com/a/34926911 |
{ | ||
"name": "utf8-buffer", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "ES6 module to encode and decode UTF-8 strings.", | ||
@@ -32,4 +32,3 @@ "homepage": "https://github.com/rochars/utf8-buffer", | ||
"dist": "dist", | ||
"externs": "externs", | ||
"lib": "lib" | ||
"externs": "externs" | ||
}, | ||
@@ -39,3 +38,2 @@ "files": [ | ||
"externs", | ||
"lib", | ||
"main.js", | ||
@@ -42,0 +40,0 @@ "main.d.ts", |
@@ -6,3 +6,3 @@ # utf8-buffer | ||
[![NPM version](https://img.shields.io/npm/v/utf8-buffer.svg?style=for-the-badge)](https://www.npmjs.com/package/utf8-buffer) [![Docs](https://img.shields.io/badge/docs-online-blue.svg?style=for-the-badge)](https://rochars.github.io/utf8-buffer/api/) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/utf8-buffer/master/test/browser.html) | ||
[![NPM version](https://img.shields.io/npm/v/utf8-buffer.svg?style=for-the-badge)](https://www.npmjs.com/package/utf8-buffer) [![Docs](https://img.shields.io/badge/docs-online-blue.svg?style=for-the-badge)](https://rochars.github.io/utf8-buffer/index.html) [![Tests](https://img.shields.io/badge/tests-online-blue.svg?style=for-the-badge)](https://rawgit.com/rochars/utf8-buffer/master/test/dist/browser.html) | ||
[![Codecov](https://img.shields.io/codecov/c/github/rochars/utf8-buffer.svg?style=flat-square)](https://codecov.io/gh/rochars/utf8-buffer) [![Unix Build](https://img.shields.io/travis/rochars/utf8-buffer.svg?style=flat-square)](https://travis-ci.org/rochars/utf8-buffer) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/utf8-buffer.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/utf8-buffer) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/utf8-buffer.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/utf8-buffer/) | ||
@@ -45,3 +45,3 @@ | ||
const utf8Buffer = require('utf8-buffer'); | ||
let packed = pack('笠߹~'); | ||
let packed = utf8Buffer.pack('笠߹~'); | ||
``` | ||
@@ -78,2 +78,3 @@ | ||
* Read a string of UTF-8 characters from a byte buffer. | ||
* Invalid characters are replaced with 'REPLACEMENT CHARACTER' (U+FFFD). | ||
* @see https://encoding.spec.whatwg.org/#the-encoding | ||
@@ -80,0 +81,0 @@ * @see https://stackoverflow.com/a/34926911 |
25685
409
131