From 8f0474b83c77590b11ad9217a8e7fd70365fd03c Mon Sep 17 00:00:00 2001 From: Double Colon Date: Sun, 7 Dec 2025 14:33:42 +0100 Subject: [PATCH] refactor: de-duplicate timestamp formatting patterns (#1440) Co-authored-by: Almeida --- deno/globals.ts | 11 ++++++----- globals.ts | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/deno/globals.ts b/deno/globals.ts index f6a69d1e..8c29636b 100644 --- a/deno/globals.ts +++ b/deno/globals.ts @@ -8,6 +8,9 @@ export type Snowflake = string; */ export type Permissions = string; +const timestampStyles = 'DFRSTdfst'; +const timestampLength = 13; + /** * @see {@link https://discord.com/developers/docs/reference#message-formatting-formats} */ @@ -76,21 +79,19 @@ export const FormattingPatterns = { * * The `timestamp` and `style` group properties are present on the `exec` result of this expression */ - // eslint-disable-next-line prefer-named-capture-group, unicorn/better-regex - Timestamp: /-?\d{1,13})(:(?