mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Add the propriety if it has _ to the object (#3828)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user