typebox 1.3.5 → 1.3.6
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/build/guard/string.mjs +16 -4
- package/package.json +1 -1
package/build/guard/string.mjs
CHANGED
|
@@ -5,6 +5,18 @@ function IsBetween(value, min, max) {
|
|
|
5
5
|
return value >= min && value <= max;
|
|
6
6
|
}
|
|
7
7
|
// --------------------------------------------------------------------------
|
|
8
|
+
// IsZeroWidthJoiner
|
|
9
|
+
// --------------------------------------------------------------------------
|
|
10
|
+
function IsZeroWidthJoiner(value) {
|
|
11
|
+
return (value === 0x200D);
|
|
12
|
+
}
|
|
13
|
+
// --------------------------------------------------------------------------
|
|
14
|
+
// IsHighSurrogate
|
|
15
|
+
// --------------------------------------------------------------------------
|
|
16
|
+
function IsHighSurrogate(value) {
|
|
17
|
+
return IsBetween(value, 0xD800, 0xDBFF);
|
|
18
|
+
}
|
|
19
|
+
// --------------------------------------------------------------------------
|
|
8
20
|
// IsRegionalIndicator
|
|
9
21
|
// --------------------------------------------------------------------------
|
|
10
22
|
function IsRegionalIndicator(value) {
|
|
@@ -72,10 +84,10 @@ function NextGraphemeClusterIndex(value, clusterStart) {
|
|
|
72
84
|
// IsGraphemeCodePoint
|
|
73
85
|
// --------------------------------------------------------------------------
|
|
74
86
|
function IsGraphemeCodePoint(value) {
|
|
75
|
-
return (
|
|
76
|
-
|
|
77
|
-
(value
|
|
78
|
-
|
|
87
|
+
return (IsHighSurrogate(value) ||
|
|
88
|
+
IsCombiningMark(value) ||
|
|
89
|
+
IsVariationSelector(value) ||
|
|
90
|
+
IsZeroWidthJoiner(value));
|
|
79
91
|
}
|
|
80
92
|
// --------------------------------------------------------------------------
|
|
81
93
|
// GraphemeCount
|