Add the propriety if it has _ to the object (#3828)

This commit is contained in:
Fleny
2024-08-07 01:20:50 -05:00
committed by GitHub
parent 14b015870d
commit 304a61c786
+6 -3
View File
@@ -194,11 +194,14 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
const newObj: any = {}
for (const key of Object.keys(obj)) {
// If the key is already in snake_case we have no reason for the rest of the code to run.
if (key.includes('_')) continue
const value = obj[key]
// If the key is already in snake_case we can assume it is already in the discord format.
if (key.includes('_')) {
newObj[key] = value
continue
}
// Some falsy values should be allowed like null or 0
if (value !== undefined) {
switch (key) {