@engine2/efa-utils
Version:
Library for EFA Apps utility functions
17 lines (14 loc) • 442 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = emptyStringToNull;
/**
* Function that converts empty string to null.
* @param {string} string to convert.
* @returns {string | null} Returns null in the case that input string is empty, returns the same input string otherwise.
*/
function emptyStringToNull(val) {
return /\S/.test(val) ? val : null;
}
module.exports = exports.default;