@apify/utilities 2.30.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.cjs +23 -0
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.ts +5 -0
- package/esm/index.d.mts +5 -0
- package/esm/index.mjs +23 -0
- package/esm/index.mjs.map +1 -1
- package/package.json +2 -2
package/cjs/index.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ declare function weightedAverage(val1: number, weight1: number, val2: number, we
|
|
|
86
86
|
/**
|
|
87
87
|
* Checks whether username is listed in FORBIDDEN_USERNAMES
|
|
88
88
|
* or matches any root route path.
|
|
89
|
+
*
|
|
90
|
+
* NOTE: The forbidden list may expand over time, so a username that was
|
|
91
|
+
* previously permitted may later become forbidden. Use this function only
|
|
92
|
+
* when validating a username change, not as part of normal authentication
|
|
93
|
+
* or authorization flow.
|
|
89
94
|
*/
|
|
90
95
|
declare function isForbiddenUsername(username: string): boolean;
|
|
91
96
|
/**
|
package/esm/index.d.mts
CHANGED
|
@@ -86,6 +86,11 @@ declare function weightedAverage(val1: number, weight1: number, val2: number, we
|
|
|
86
86
|
/**
|
|
87
87
|
* Checks whether username is listed in FORBIDDEN_USERNAMES
|
|
88
88
|
* or matches any root route path.
|
|
89
|
+
*
|
|
90
|
+
* NOTE: The forbidden list may expand over time, so a username that was
|
|
91
|
+
* previously permitted may later become forbidden. Use this function only
|
|
92
|
+
* when validating a username change, not as part of normal authentication
|
|
93
|
+
* or authorization flow.
|
|
89
94
|
*/
|
|
90
95
|
declare function isForbiddenUsername(username: string): boolean;
|
|
91
96
|
/**
|
package/esm/index.mjs
CHANGED
|
@@ -556,6 +556,29 @@ var FORBIDDEN_USERNAMES_REGEXPS = [
|
|
|
556
556
|
"(\\..*)",
|
|
557
557
|
// Username starting with xxx-
|
|
558
558
|
"(xxx-.*)",
|
|
559
|
+
// Usernames containing inappropriate/adult content keywords
|
|
560
|
+
"(.*porn.*)",
|
|
561
|
+
"(.*vagina.*)",
|
|
562
|
+
"(.*dildo.*)",
|
|
563
|
+
"(.*nsfw.*)",
|
|
564
|
+
"(.*hentai.*)",
|
|
565
|
+
"(.*cunt.*)",
|
|
566
|
+
"(.*fuck.*)",
|
|
567
|
+
"(.*shit.*)",
|
|
568
|
+
"(.*bitch.*)",
|
|
569
|
+
"(.*slut.*)",
|
|
570
|
+
"(.*whore.*)",
|
|
571
|
+
"(.*boob.*)",
|
|
572
|
+
"(.*tits.*)",
|
|
573
|
+
// Words that require non-letter boundaries to avoid false positives with
|
|
574
|
+
// legitimate surnames (Dickens, Hancock, Nudelman) and words (Uranus, pussycat, snaked)
|
|
575
|
+
"((.+[^a-z]|)cock([^a-z].+|))",
|
|
576
|
+
"((.+[^a-z]|)dick([^a-z].+|))",
|
|
577
|
+
"((.+[^a-z]|)anus([^a-z].+|))",
|
|
578
|
+
"((.+[^a-z]|)pussy([^a-z].+|))",
|
|
579
|
+
"((.+[^a-z]|)nude([^a-z].+|))",
|
|
580
|
+
"((.+[^a-z]|)penis([^a-z].+|))",
|
|
581
|
+
"((.+[^a-z]|)naked([^a-z].+|))",
|
|
559
582
|
// Username starting with install-cli. (see https://docs.apify.com/cli/docs/installation)
|
|
560
583
|
"(install-cli\\..*)",
|
|
561
584
|
// Strings not starting with letter or number
|