1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.mentionServices = exports.isValidMention = exports.isMentionTextChar = void 0;
|
4 | var mentionRegexes = {
|
5 | twitter: /^@\w{1,15}$/,
|
6 | instagram: /^@[_\w]{1,30}$/,
|
7 | soundcloud: /^@[-a-z0-9_]{3,25}$/,
|
8 |
|
9 |
|
10 | tiktok: /^@[.\w]{1,23}[\w]$/,
|
11 | };
|
12 |
|
13 |
|
14 |
|
15 | var mentionTextCharRe = /[-\w.]/;
|
16 |
|
17 |
|
18 |
|
19 | function isMentionTextChar(char) {
|
20 | return mentionTextCharRe.test(char);
|
21 | }
|
22 | exports.isMentionTextChar = isMentionTextChar;
|
23 |
|
24 |
|
25 |
|
26 | function isValidMention(mention, serviceName) {
|
27 | var re = mentionRegexes[serviceName];
|
28 | return re.test(mention);
|
29 | }
|
30 | exports.isValidMention = isValidMention;
|
31 | exports.mentionServices = ['twitter', 'instagram', 'soundcloud', 'tiktok'];
|
32 |
|
\ | No newline at end of file |