@sphereon/ssi-sdk.data-store
Version:
23 lines • 729 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceNullWithUndefined = void 0;
const replaceNullWithUndefined = (obj) => {
if (obj === null) {
return undefined;
}
if (typeof obj !== 'object' || obj instanceof Date) {
return obj;
}
if (Array.isArray(obj)) {
return obj.map((value) => (0, exports.replaceNullWithUndefined)(value));
}
const result = {};
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
result[key] = (0, exports.replaceNullWithUndefined)(obj[key]);
}
}
return result;
};
exports.replaceNullWithUndefined = replaceNullWithUndefined;
//# sourceMappingURL=FormattingUtils.js.map