Files
react-native-devtools-frontend/node_modules/text-decoder
Alex Rudenko 09712c6777 Roll puppeteer-core to 23.8.0
No-Presubmit: true
Bug: none
Change-Id: Ie0ddc7007c14ecc54c2aca66f22d204c93911d0f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6038617
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2024-11-21 09:48:27 +00:00
..
2024-11-21 09:48:27 +00:00
2024-11-21 09:48:27 +00:00
2024-08-02 09:19:05 +00:00
2024-11-21 09:48:27 +00:00
2024-08-02 09:19:05 +00:00

text-decoder

Streaming text decoder that preserves multibyte Unicode characters.

npm i text-decoder

Usage

const TextDecoder = require('text-decoder')

const td = new TextDecoder()

td.push(Buffer.of(0xf0, 0x9f, 0x92)) // returns ''
td.push(Buffer.of(0xa9)) // returns '💩'

API

const td = new TextDecoder([encoding])

Create a text decoder. encoding defaults to utf8.

const string = td.push(data)

Push either a Buffer or a string to the text decoder. Returns the decoded string, buffering any partial data.

const string = td.end([data])

End the decoder, optionally pushing a final piece of data. Returns the decoded string.

License

Apache-2.0