UNPKG

voca

Version:

The ultimate JavaScript string library

31 lines (27 loc) 811 B
import './internal/is_nil.js'; import './is_string.js'; import { c as coerceToString } from './internal/coerce_to_string.js'; import './internal/const.js'; import './internal/const_extended.js'; import isAlpha from './is_alpha.js'; /** * Checks whether `subject` contains only upper case characters. * * @function isUpperCase * @static * @since 1.0.0 * @memberOf Query * @param {string} [subject=''] The string to verify. * @return {boolean} Returns `true` if `subject` is upper case or `false` otherwise. * @example * v.isUpperCase('ACDC'); * // => true * * v.isUpperCase('Morning'); * // => false */ function isUpperCase(subject) { var subjectString = coerceToString(subject); return isAlpha(subjectString) && subjectString.toUpperCase() === subjectString; } export default isUpperCase;