1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

remove ts annotations as I don't want to convert the whole file now

This commit is contained in:
Bruno Windels
2020-04-02 13:17:49 +02:00
parent 6144962c24
commit 43eae4929b

View File

@@ -236,21 +236,21 @@ export class QRCodeData {
static _generateBuffer(qrData) { static _generateBuffer(qrData) {
let buf = Buffer.alloc(0); // we'll concat our way through life let buf = Buffer.alloc(0); // we'll concat our way through life
const appendByte = (b: number) => { const appendByte = (b) => {
const tmpBuf = Buffer.from([b]); const tmpBuf = Buffer.from([b]);
buf = Buffer.concat([buf, tmpBuf]); buf = Buffer.concat([buf, tmpBuf]);
}; };
const appendInt = (i: number) => { const appendInt = (i) => {
const tmpBuf = Buffer.alloc(2); const tmpBuf = Buffer.alloc(2);
tmpBuf.writeInt16BE(i, 0); tmpBuf.writeInt16BE(i, 0);
buf = Buffer.concat([buf, tmpBuf]); buf = Buffer.concat([buf, tmpBuf]);
}; };
const appendStr = (s: string, enc: string, withLengthPrefix = true) => { const appendStr = (s, enc, withLengthPrefix = true) => {
const tmpBuf = Buffer.from(s, enc); const tmpBuf = Buffer.from(s, enc);
if (withLengthPrefix) appendInt(tmpBuf.byteLength); if (withLengthPrefix) appendInt(tmpBuf.byteLength);
buf = Buffer.concat([buf, tmpBuf]); buf = Buffer.concat([buf, tmpBuf]);
}; };
const appendEncBase64 = (b64: string) => { const appendEncBase64 = (b64) => {
const b = decodeBase64(b64); const b = decodeBase64(b64);
const tmpBuf = Buffer.from(b); const tmpBuf = Buffer.from(b);
buf = Buffer.concat([buf, tmpBuf]); buf = Buffer.concat([buf, tmpBuf]);