Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: 25.x
node-version: 26.x
cache: npm

- run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Du hast 2 Optionen: [Lokale installation](#lokale-installation) und [GitHub Code

### Lokale Installation

<sub>node Version: >=25</sub>
<sub>node Version: >=26</sub>

1. Terminal aufmachen und dorthin navigieren, wo man es downloaden möchte
2. Sichergehen, dass [Node.js](https://nodejs.org) installiert ist. Teste mit: `node --version`. Wenn es eine Versionsnummer zurückgibt, ist Node.js installiert.
Expand Down
21 changes: 1 addition & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
},
"dependencies": {
"@discordjs/voice": "^0.19.2",
"@js-temporal/polyfill": "^0.5.1",
"@napi-rs/canvas": "1.0.0",
"@resvg/resvg-js": "^2.6.2",
"@sentry/node": "^10.51.0",
Expand Down Expand Up @@ -65,7 +64,7 @@
"oxlint-tsgolint": "^0.22.1"
},
"engines": {
"node": ">=25.6.1"
"node": ">=26"
},
"trustedDependencies": [
"lefthook"
Expand Down
16 changes: 0 additions & 16 deletions src/polyfills.test.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
import { Temporal as PolyfillTemporal } from "@js-temporal/polyfill";

declare global {
// type polyfill for Math.sumPrecise (currently in stage 2):
// https://github.com/tc39/proposal-math-sum
// Remove this as soon as it is stable
interface Math {
sumPrecise: (values: number[]) => number;
}

// https://github.com/tc39/proposal-upsert
interface Map<K, V> {
getOrInsert(key: K, defaultValue: V): V;
getOrInsertComputed<TK extends K>(key: TK, callbackFunction: (key: TK) => V): V;
}
}

globalThis.Temporal = PolyfillTemporal as typeof Temporal;

// TODO: Remove this once temporal is available in Node.js, see: https://github.com/nodejs/node/issues/57127
if (typeof Date.prototype.toTemporalInstant !== "function") {
Date.prototype.toTemporalInstant = function () {
return Temporal.Instant.fromEpochMilliseconds(this.getTime());
};
}

if (typeof Math.sumPrecise !== "function") {
// intentionally very cheap implementation. But does the thing.
Math.sumPrecise = (values: number[]) => values.reduce((a, b) => a + b, 0);
}

// https://github.com/tc39/proposal-upsert
if (typeof Map.prototype.getOrInsert === "undefined") {
Map.prototype.getOrInsert = function <K, V>(this: Map<K, V>, key: K, defaultValue: V): V {
const v = this.get(key);
if (v !== undefined) {
return v;
}

this.set(key, defaultValue);
return defaultValue;
};
}
if (typeof Map.prototype.getOrInsertComputed === "undefined") {
Map.prototype.getOrInsertComputed = function <K, V>(
this: Map<K, V>,
key: K,
callbackFunction: (key: K) => V,
): V {
const v = this.get(key);
if (v !== undefined) {
return v;
}

const defaultValue = callbackFunction(key);
this.set(key, defaultValue);
return defaultValue;
};
}
Loading