@@ -82,48 +82,38 @@ if (internalBinding('config').hasIntl) {
82
82
* Unicode code point is full-width. Otherwise returns false.
83
83
*/
84
84
isFullWidthCodePoint = function isFullWidthCodePoint ( code ) {
85
- if ( ! Number . isInteger ( code ) ) {
86
- return false ;
87
- }
88
-
89
85
// Code points are derived from:
90
86
// http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
91
- if (
92
- code >= 0x1100 && (
93
- code <= 0x115f || // Hangul Jamo
94
- code === 0x2329 || // LEFT-POINTING ANGLE BRACKET
95
- code === 0x232a || // RIGHT-POINTING ANGLE BRACKET
96
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
97
- code >= 0x2e80 && code <= 0x3247 && code !== 0x303f ||
98
- // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
99
- code >= 0x3250 && code <= 0x4dbf ||
100
- // CJK Unified Ideographs .. Yi Radicals
101
- code >= 0x4e00 && code <= 0xa4c6 ||
102
- // Hangul Jamo Extended-A
103
- code >= 0xa960 && code <= 0xa97c ||
104
- // Hangul Syllables
105
- code >= 0xac00 && code <= 0xd7a3 ||
106
- // CJK Compatibility Ideographs
107
- code >= 0xf900 && code <= 0xfaff ||
108
- // Vertical Forms
109
- code >= 0xfe10 && code <= 0xfe19 ||
110
- // CJK Compatibility Forms .. Small Form Variants
111
- code >= 0xfe30 && code <= 0xfe6b ||
112
- // Halfwidth and Fullwidth Forms
113
- code >= 0xff01 && code <= 0xff60 ||
114
- code >= 0xffe0 && code <= 0xffe6 ||
115
- // Kana Supplement
116
- code >= 0x1b000 && code <= 0x1b001 ||
117
- // Enclosed Ideographic Supplement
118
- code >= 0x1f200 && code <= 0x1f251 ||
119
- // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
120
- code >= 0x20000 && code <= 0x3fffd
121
- )
122
- ) {
123
- return true ;
124
- }
125
-
126
- return false ;
87
+ return Number . isInteger ( code ) && code >= 0x1100 && (
88
+ code <= 0x115f || // Hangul Jamo
89
+ code === 0x2329 || // LEFT-POINTING ANGLE BRACKET
90
+ code === 0x232a || // RIGHT-POINTING ANGLE BRACKET
91
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
92
+ code >= 0x2e80 && code <= 0x3247 && code !== 0x303f ||
93
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
94
+ code >= 0x3250 && code <= 0x4dbf ||
95
+ // CJK Unified Ideographs .. Yi Radicals
96
+ code >= 0x4e00 && code <= 0xa4c6 ||
97
+ // Hangul Jamo Extended-A
98
+ code >= 0xa960 && code <= 0xa97c ||
99
+ // Hangul Syllables
100
+ code >= 0xac00 && code <= 0xd7a3 ||
101
+ // CJK Compatibility Ideographs
102
+ code >= 0xf900 && code <= 0xfaff ||
103
+ // Vertical Forms
104
+ code >= 0xfe10 && code <= 0xfe19 ||
105
+ // CJK Compatibility Forms .. Small Form Variants
106
+ code >= 0xfe30 && code <= 0xfe6b ||
107
+ // Halfwidth and Fullwidth Forms
108
+ code >= 0xff01 && code <= 0xff60 ||
109
+ code >= 0xffe0 && code <= 0xffe6 ||
110
+ // Kana Supplement
111
+ code >= 0x1b000 && code <= 0x1b001 ||
112
+ // Enclosed Ideographic Supplement
113
+ code >= 0x1f200 && code <= 0x1f251 ||
114
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
115
+ code >= 0x20000 && code <= 0x3fffd
116
+ ) ;
127
117
} ;
128
118
}
129
119
0 commit comments