mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Depracations + Semantic Changes
This commit is contained in:
@@ -23,7 +23,7 @@ export default class Decoder {
|
||||
const value = this.buffer.slice(this.index, this.index + length)
|
||||
|
||||
this.index += length
|
||||
return new TextDecoder().decode(value)
|
||||
return value.toString ('utf-8')
|
||||
}
|
||||
readBytes(n: number): Buffer {
|
||||
this.checkEOS(n)
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class Encoder {
|
||||
this.data.push.apply(this.data, bytes)
|
||||
}
|
||||
pushString(str: string) {
|
||||
const bytes = new TextEncoder().encode(str)
|
||||
const bytes = Buffer.from (str, 'utf-8')
|
||||
this.pushBytes(bytes)
|
||||
}
|
||||
writeByteLength(length: number) {
|
||||
|
||||
Reference in New Issue
Block a user