summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-14 06:01:48 +0100
committerRory& <root@rory.gay>2026-03-14 06:01:48 +0100
commitc8af1e125fc67074bd549f4fdbd96b6c77dc518c (patch)
treec241f1634eb5ff496bb909f29f4873aaa2df0ae9 /src
parentremove duplicate / in url regex (diff)
downloadserver-ts-c8af1e125fc67074bd549f4fdbd96b6c77dc518c.tar.xz
Remove array global pollution
Diffstat (limited to 'src')
-rw-r--r--src/util/entities/Channel.ts5
-rw-r--r--src/util/util/extensions/Array.test.ts9
-rw-r--r--src/util/util/extensions/Array.ts10
3 files changed, 3 insertions, 21 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 57960ecd..9c7ddb57 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -197,7 +197,7 @@ export class Channel extends BaseClass { skipEventEmit?: boolean; skipNameChecks?: boolean; }, - ) { + ): Promise<Channel> { if (!opts?.skipPermissionCheck) { // Always check if user has permission first const permissions = await getPermission(user_id, channel.guild_id); @@ -281,7 +281,8 @@ export class Channel extends BaseClass { // total_message_sent: 0, }; - const ret = Channel.create(channel); + // TODO: figure out why the generic is required here + const ret = Channel.create<Channel>(channel); await Promise.all([ ret.save(), diff --git a/src/util/util/extensions/Array.test.ts b/src/util/util/extensions/Array.test.ts deleted file mode 100644
index 6984dfdb..00000000 --- a/src/util/util/extensions/Array.test.ts +++ /dev/null
@@ -1,9 +0,0 @@ -import moduleAlias from "module-alias"; -moduleAlias(); -import "./Array"; -import { describe, it } from "node:test"; -import assert from "node:assert/strict"; - -describe("Array extensions", () => { - // -}); diff --git a/src/util/util/extensions/Array.ts b/src/util/util/extensions/Array.ts
index f17e8650..f9cb2fc5 100644 --- a/src/util/util/extensions/Array.ts +++ b/src/util/util/extensions/Array.ts
@@ -16,14 +16,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -declare global { - interface Array<T> { - /** - * @deprecated never use, idk why but I can't get rid of this without errors - */ - remove(h: T): never; - } -} /* https://stackoverflow.com/a/50636286 */ export function arrayPartition<T>(array: T[], filter: (elem: T) => boolean): [T[], T[]] { const pass: T[] = [], @@ -38,5 +30,3 @@ export function arrayRemove<T>(array: T[], item: T): void { array.splice(index, 1); } } - -// register extensions