From c36b0ae05e60a21e4d3a06899899697450a08134 Mon Sep 17 00:00:00 2001 From: sunny00217wm Date: Wed, 9 Feb 2022 11:14:47 +0800 Subject: [PATCH] No longer needed --- src/date.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/date.ts b/src/date.ts index 7b4e93a..2465ad0 100644 --- a/src/date.ts +++ b/src/date.ts @@ -117,10 +117,6 @@ export interface MwnDateStatic { populateLocaleData(lang?: string): Promise; } -type startWith> = { - [key in keyof O]: key extends `${S}${string}` ? O[key] : never; -}; - export default function (bot: mwn) { class XDate extends Date implements MwnDate { constructor(...args: ConstructorParameters); @@ -378,18 +374,6 @@ export default function (bot: mwn) { } } - // Tweak set* methods (setHours, setUTCMinutes, etc) so that they - // return the modified XDate object rather than the seconds-since-epoch - // representation which is what JS Date() gives - (<(keyof startWith<'set', XDate>)[]>Object.getOwnPropertyNames(Date.prototype)) - .filter((f) => typeof f === 'string' && f.startsWith('set')) - .forEach((func) => { - let proxy = XDate.prototype[func]; - XDate.prototype[func] = function (...args: Parameters) { - return proxy.call(this, ...args); - }; - }); - return XDate as MwnDateStatic; }