11cb0ef41Sopenharmony_ci/* eslint-disable yoda */ 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ciconst isFullwidthCodePoint = codePoint => { 51cb0ef41Sopenharmony_ci if (Number.isNaN(codePoint)) { 61cb0ef41Sopenharmony_ci return false; 71cb0ef41Sopenharmony_ci } 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci // Code points are derived from: 101cb0ef41Sopenharmony_ci // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt 111cb0ef41Sopenharmony_ci if ( 121cb0ef41Sopenharmony_ci codePoint >= 0x1100 && ( 131cb0ef41Sopenharmony_ci codePoint <= 0x115F || // Hangul Jamo 141cb0ef41Sopenharmony_ci codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET 151cb0ef41Sopenharmony_ci codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET 161cb0ef41Sopenharmony_ci // CJK Radicals Supplement .. Enclosed CJK Letters and Months 171cb0ef41Sopenharmony_ci (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || 181cb0ef41Sopenharmony_ci // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A 191cb0ef41Sopenharmony_ci (0x3250 <= codePoint && codePoint <= 0x4DBF) || 201cb0ef41Sopenharmony_ci // CJK Unified Ideographs .. Yi Radicals 211cb0ef41Sopenharmony_ci (0x4E00 <= codePoint && codePoint <= 0xA4C6) || 221cb0ef41Sopenharmony_ci // Hangul Jamo Extended-A 231cb0ef41Sopenharmony_ci (0xA960 <= codePoint && codePoint <= 0xA97C) || 241cb0ef41Sopenharmony_ci // Hangul Syllables 251cb0ef41Sopenharmony_ci (0xAC00 <= codePoint && codePoint <= 0xD7A3) || 261cb0ef41Sopenharmony_ci // CJK Compatibility Ideographs 271cb0ef41Sopenharmony_ci (0xF900 <= codePoint && codePoint <= 0xFAFF) || 281cb0ef41Sopenharmony_ci // Vertical Forms 291cb0ef41Sopenharmony_ci (0xFE10 <= codePoint && codePoint <= 0xFE19) || 301cb0ef41Sopenharmony_ci // CJK Compatibility Forms .. Small Form Variants 311cb0ef41Sopenharmony_ci (0xFE30 <= codePoint && codePoint <= 0xFE6B) || 321cb0ef41Sopenharmony_ci // Halfwidth and Fullwidth Forms 331cb0ef41Sopenharmony_ci (0xFF01 <= codePoint && codePoint <= 0xFF60) || 341cb0ef41Sopenharmony_ci (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || 351cb0ef41Sopenharmony_ci // Kana Supplement 361cb0ef41Sopenharmony_ci (0x1B000 <= codePoint && codePoint <= 0x1B001) || 371cb0ef41Sopenharmony_ci // Enclosed Ideographic Supplement 381cb0ef41Sopenharmony_ci (0x1F200 <= codePoint && codePoint <= 0x1F251) || 391cb0ef41Sopenharmony_ci // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane 401cb0ef41Sopenharmony_ci (0x20000 <= codePoint && codePoint <= 0x3FFFD) 411cb0ef41Sopenharmony_ci ) 421cb0ef41Sopenharmony_ci ) { 431cb0ef41Sopenharmony_ci return true; 441cb0ef41Sopenharmony_ci } 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci return false; 471cb0ef41Sopenharmony_ci}; 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_cimodule.exports = isFullwidthCodePoint; 501cb0ef41Sopenharmony_cimodule.exports.default = isFullwidthCodePoint; 51