UNPKG

hangul-util

Version:
25 lines (24 loc) 853 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCho = isCho; exports.isChoByChar = isChoByChar; exports.isChoByGroups = isChoByGroups; var _constant = require("./constant"); var _isJong = require("./isJong"); function isChoByChar() { var cho = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; return (0, _isJong.isJongByCode)(cho.charCodeAt(0)) && !_constant.JONG_COMPLETE_HANGUL[cho]; } function isCho() { var word = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; for (var index = 0; index < word.length; index++) { if (!isChoByChar(word[index])) return false; } return !!word; } function isChoByGroups() { var word = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; return word.toString().split("").map(isChoByChar); }