summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-19 19:35:54 +0100
committerRory& <root@rory.gay>2025-12-19 19:35:54 +0100
commit3636d615db95f6d0bd2560a27131b541fa51aa22 (patch)
tree8acadc787b48a9218bc76eaad8864945db3e67d5 /src
parentDEPRECATION: Move most select queries to object instead of string[] (diff)
downloadserver-ts-3636d615db95f6d0bd2560a27131b541fa51aa22.tar.xz
ESLint: warn for deprecated constructs
Diffstat (limited to 'src')
-rw-r--r--src/api/util/utility/RandomInviteID.ts6
-rw-r--r--src/util/util/Event.ts4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/api/util/utility/RandomInviteID.ts b/src/api/util/utility/RandomInviteID.ts

index 0718a736..d7f2c629 100644 --- a/src/api/util/utility/RandomInviteID.ts +++ b/src/api/util/utility/RandomInviteID.ts
@@ -49,7 +49,11 @@ export function snowflakeBasedInvite() { snowflake = snowflake / base; } - return str.substr(3, 8).split("").reverse().join(""); + return str + .slice(3, 3 + 8) + .split("") + .reverse() + .join(""); } export function randomUpperString(length: number = 10) { diff --git a/src/util/util/Event.ts b/src/util/util/Event.ts
index a9f129c7..e2be9b19 100644 --- a/src/util/util/Event.ts +++ b/src/util/util/Event.ts
@@ -204,8 +204,8 @@ class UnixSocketListener { while (buffer.length >= 4) { const msgLen = buffer.readUInt32BE(0); if (buffer.length < 4 + msgLen) break; - const msgBuf = buffer.slice(4, 4 + msgLen); - buffer = buffer.slice(4 + msgLen); + const msgBuf = buffer.subarray(4, 4 + msgLen); + buffer = buffer.subarray(4 + msgLen); try { const payload = JSON.parse(msgBuf.toString()); this.eventEmitter.emit(payload.id, payload.event);