rategame-shared 1.1.484 → 1.1.485

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.
@@ -14,6 +14,8 @@
14
14
  * - "Upside-down" / "turned" letters used by flip-text generators
15
15
  * (⊥, ǝ, ɹ, ʇ, ʞ, ʎ, ɥ, ɐ, ɔ, ∀, ᗺ, ⅄, ...). Requires ≥2 of these
16
16
  * to avoid false positives from a stray IPA character.
17
+ * - Cherokee letters used as Latin lookalikes (ᏇᏋᎥᏒᎴ). Requires ≥2 so an
18
+ * isolated Cherokee character does not reject otherwise normal text.
17
19
  *
18
20
  * Shared by the API (server-side guard) and clients (pre-submit guard).
19
21
  */
@@ -15,6 +15,8 @@
15
15
  * - "Upside-down" / "turned" letters used by flip-text generators
16
16
  * (⊥, ǝ, ɹ, ʇ, ʞ, ʎ, ɥ, ɐ, ɔ, ∀, ᗺ, ⅄, ...). Requires ≥2 of these
17
17
  * to avoid false positives from a stray IPA character.
18
+ * - Cherokee letters used as Latin lookalikes (ᏇᏋᎥᏒᎴ). Requires ≥2 so an
19
+ * isolated Cherokee character does not reject otherwise normal text.
18
20
  *
19
21
  * Shared by the API (server-side guard) and clients (pre-submit guard).
20
22
  */
@@ -92,13 +94,29 @@ function containsTurnedLetters(text) {
92
94
  }
93
95
  return false;
94
96
  }
97
+ function containsCherokeeLookalikes(text) {
98
+ let count = 0;
99
+ for (const ch of text) {
100
+ const cp = ch.codePointAt(0);
101
+ const isCherokeeLetter = (cp >= 0x13a0 && cp <= 0x13f5) ||
102
+ (cp >= 0x13f8 && cp <= 0x13fd) ||
103
+ (cp >= 0xab70 && cp <= 0xabbf);
104
+ if (isCherokeeLetter) {
105
+ count++;
106
+ if (count >= 2)
107
+ return true;
108
+ }
109
+ }
110
+ return false;
111
+ }
95
112
  function containsFancyText(text) {
96
113
  if (!text)
97
114
  return false;
98
115
  return (containsMathAlphanumeric(text) ||
99
116
  containsFullwidthAlphanumeric(text) ||
100
117
  containsEnclosedAlphanumeric(text) ||
101
- containsTurnedLetters(text));
118
+ containsTurnedLetters(text) ||
119
+ containsCherokeeLookalikes(text));
102
120
  }
103
121
  exports.containsFancyText = containsFancyText;
104
122
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.484",
3
+ "version": "1.1.485",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",