fix: properly serialize undefined values (#7497)

This commit is contained in:
Suneet Tipirneni
2022-02-20 07:41:50 -05:00
committed by GitHub
parent 942ea1acbf
commit 8dbd34544c

View File

@@ -8,7 +8,7 @@ class Transformers extends null {
* @param {*} obj The object to transform * @param {*} obj The object to transform
* @returns {*} * @returns {*}
*/ */
static toSnakeCase(obj = {}) { static toSnakeCase(obj) {
if (typeof obj !== 'object' || !obj) return obj; if (typeof obj !== 'object' || !obj) return obj;
if (Array.isArray(obj)) return obj.map(Transformers.toSnakeCase); if (Array.isArray(obj)) return obj.map(Transformers.toSnakeCase);
return Object.fromEntries( return Object.fromEntries(