mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
fix: properly serialize undefined values (#7497)
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user