@nomad-xyz/sdk
Version:
24 lines • 684 B
JavaScript
;
// Disable eslint to allow any type for the following function to work with any types
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });
exports.nulls2undefined = void 0;
/**
* Replaces all null values in an object with `undefined`
* @param obj an object
* @returns object with no null values
*/
function nulls2undefined(obj) {
if (obj === null) {
return undefined;
}
if (typeof obj === 'object') {
for (const key in obj) {
obj[key] = nulls2undefined(obj[key]);
}
}
return obj;
}
exports.nulls2undefined = nulls2undefined;
/* eslint-enable */
//# sourceMappingURL=utils.js.map