@kernel-js/support
Version:
Support package for Kernel Framework
26 lines (21 loc) • 508 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _index = require("./index");
/**
* If value isEmpty then change to null
*
* @param {object} value
* @returns {*}
*/
var mapEmptyToNull = function mapEmptyToNull(value) {
if (!(0, _index.isObject)(value)) {
return value;
}
return (0, _index.mapValues)(value, function (v) {
return (0, _index.isEmpty)(v) ? null : v;
});
};
exports.default = mapEmptyToNull;
module.exports = exports["default"];
;