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.
@@ -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 (IsBetween(value, 0xD800, 0xDBFF) || // High surrogate
76
- IsBetween(value, 0x0300, 0x036F) || // Combining diacritical marks
77
- (value === 0x200D) // Zero-width joiner
78
- );
87
+ return (IsHighSurrogate(value) ||
88
+ IsCombiningMark(value) ||
89
+ IsVariationSelector(value) ||
90
+ IsZeroWidthJoiner(value));
79
91
  }
80
92
  // --------------------------------------------------------------------------
81
93
  // GraphemeCount
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.3.5",
4
+ "version": "1.3.6",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"