mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 05:34:21 +08:00
Bug: none Change-Id: I4ac9c6a9685a4699ddf91c71a88ad070f43128b0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5756162 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
14 lines
302 B
JavaScript
14 lines
302 B
JavaScript
module.exports = class BrowserDecoder {
|
|
constructor (encoding) {
|
|
this.decoder = new TextDecoder(encoding === 'utf16le' ? 'utf16-le' : encoding)
|
|
}
|
|
|
|
decode (data) {
|
|
return this.decoder.decode(data, { stream: true })
|
|
}
|
|
|
|
flush () {
|
|
return this.decoder.decode(new Uint8Array(0))
|
|
}
|
|
}
|