add hw2
This commit is contained in:
17
node_modules/text-decoder/lib/browser-decoder.js
generated
vendored
Normal file
17
node_modules/text-decoder/lib/browser-decoder.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
module.exports = class BrowserDecoder {
|
||||
constructor (encoding) {
|
||||
this.decoder = new TextDecoder(encoding === 'utf16le' ? 'utf16-le' : encoding)
|
||||
}
|
||||
|
||||
get remaining () {
|
||||
return -1
|
||||
}
|
||||
|
||||
decode (data) {
|
||||
return this.decoder.decode(data, { stream: true })
|
||||
}
|
||||
|
||||
flush () {
|
||||
return this.decoder.decode(new Uint8Array(0))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user