text-is-upper-case
Version:
Returns `true` if text is upper case only.
13 lines (12 loc) • 372 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isUpperCase = isUpperCase;
/**
* Returns a boolean indicating whether text is upper case.
*/
function isUpperCase(input) {
// Handle null/undefined inputs gracefully
if (!input)
return false;
return input.toUpperCase() === input && input.toLowerCase() !== input;
}