HarshvardhanCn01/Voice-Assistant
0
1/* eslint-disable yoda */2'use strict';3 4const isFullwidthCodePoint = codePoint => {5 if (Number.isNaN(codePoint)) {6 return false;7 }8 9 // Code points are derived from:10 // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt11 if (12 codePoint >= 0x1100 && (13 codePoint <= 0x115F || // Hangul Jamo14 codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET15 codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET16 // CJK Radicals Supplement .. Enclosed CJK Letters and Months17 (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||18 // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A19 (0x3250 <= codePoint && codePoint <= 0x4DBF) ||20 // CJK Unified Ideographs .. Yi Radicals21 (0x4E00 <= codePoint && codePoint <= 0xA4C6) ||22 // Hangul Jamo Extended-A23 (0xA960 <= codePoint && codePoint <= 0xA97C) ||24 // Hangul Syllables25 (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||26 // CJK Compatibility Ideographs27 (0xF900 <= codePoint && codePoint <= 0xFAFF) ||28 // Vertical Forms29 (0xFE10 <= codePoint && codePoint <= 0xFE19) ||30 // CJK Compatibility Forms .. Small Form Variants31 (0xFE30 <= codePoint && codePoint <= 0xFE6B) ||32 // Halfwidth and Fullwidth Forms33 (0xFF01 <= codePoint && codePoint <= 0xFF60) ||34 (0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||35 // Kana Supplement36 (0x1B000 <= codePoint && codePoint <= 0x1B001) ||37 // Enclosed Ideographic Supplement38 (0x1F200 <= codePoint && codePoint <= 0x1F251) ||39 // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane40 (0x20000 <= codePoint && codePoint <= 0x3FFFD)41 )42 ) {43 return true;44 }45 46 return false;47};48 49module.exports = isFullwidthCodePoint;50module.exports.default = isFullwidthCodePoint;51 