From 3bf9738a723a1923e78712240b5e28e2bb85ced8 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Wed, 3 Feb 2021 00:47:20 +0200 Subject: [PATCH] chore: shorten regular expression group properties (#80) They are now strictly `id`, `name`, or `animated`. --- common/index.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/common/index.ts b/common/index.ts index b5aef78e..09aae408 100644 --- a/common/index.ts +++ b/common/index.ts @@ -172,51 +172,51 @@ export const FormattingPatterns = { /** * Regular expression for matching a user mention, strictly without a nickname * - * The `userID` group property is present on the `exec` result of this expression + * The `id` group property is present on the `exec` result of this expression */ - User: /<@(?\d{17,20})>/, + User: /<@(?\d{17,20})>/, /** * Regular expression for matching a user mention, strictly with a nickname * - * The `userID` group property is present on the `exec` result of this expression + * The `id` group property is present on the `exec` result of this expression */ - UserWithNickname: /<@!(?\d{17,20})>/, + UserWithNickname: /<@!(?\d{17,20})>/, /** * Regular expression for matching a user mention, with or without a nickname * - * The `userID` group property is present on the `exec` result of this expression + * The `id` group property is present on the `exec` result of this expression */ - UserWithOptionalNickname: /<@!?(?\d{17,20})>/, + UserWithOptionalNickname: /<@!?(?\d{17,20})>/, /** * Regular expression for matching a channel mention * - * The `channelID` group property is present on the `exec` result of this expression + * The `id` group property is present on the `exec` result of this expression */ - Channel: /<#(?\d{17,20})>/, + Channel: /<#(?\d{17,20})>/, /** * Regular expression for matching a role mention * - * The `roleID` group property is present on the `exec` result of this expression + * The `id` group property is present on the `exec` result of this expression */ - Role: /<@&(?\d{17,20})>/, + Role: /<@&(?\d{17,20})>/, /** * Regular expression for matching a custom emoji, either static or animated * - * The `emojiAnimated`, `emojiName` and `emojiID` group properties are present on the `exec` result of this expression + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression */ - Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, + Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, /** * Regular expression for matching strictly an animated custom emoji * - * The `emojiAnimated`, `emojiName` and `emojiID` group properties are present on the `exec` result of this expression + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression */ - AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, + AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, /** * Regular expression for matching strictly a static custom emoji * - * The `emojiName` and `emojiID` group properties are present on the `exec` result of this expression + * The `name` and `id` group properties are present on the `exec` result of this expression */ - StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, + StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, } as const; /**