@nodecg/json-schema-lib
Version:
Extensible JSON Schema library with support for multi-file schemas using $ref
19 lines (16 loc) • 312 B
JavaScript
;
module.exports = lowercase;
/**
* Returns the given string in lowercase, or null if the value is not a string.
*
* @param {*} str
* @returns {string|null}
*/
function lowercase (str) {
if (str && typeof str === 'string') {
return str.toLowerCase();
}
else {
return null;
}
}