Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Дополнение resolveResourse #508

Open
Donomas opened this issue Aug 22, 2022 · 1 comment
Open

Дополнение resolveResourse #508

Donomas opened this issue Aug 22, 2022 · 1 comment
Labels
package: vk-io Issues related to vk-io

Comments

@Donomas
Copy link

Donomas commented Aug 22, 2022

Добавить поддержку ссылки vk.me

@Donomas Donomas added the package: vk-io Issues related to vk-io label Aug 22, 2022
@nitreojs
Copy link
Contributor

nitreojs commented Aug 26, 2022

problem source:

const isVKUrlRe = /^(?:https:\/\/)?(?:m\.)?vk.com\//i;

solution:
достаточно занести com в non-matching union группу (?:com|me):

const isVKUrlRe = /^(?:https?:\/\/)?(?:m\.)?vk\.(?:com|me)\//i;

(плюсом в данной регулярке ещё зафиксил http[s] и экранировал точку здесь: vk\.(?:com|me))

upd. apparently, vk.ru теперь тоже валидный домен, поэтому:

const isVKUrlRe = /^(?:https?:\/\/)?(?:m\.)?vk\.(?:com|me|ru)\//i;

upd. fixed in #513

@negezor

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
package: vk-io Issues related to vk-io
Projects
None yet
Development

No branches or pull requests

2 participants