mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
rename isObject to isConvertableObject and fix blob convertion
This commit is contained in:
@@ -51,9 +51,10 @@ function snakeToCamelCase(text: string) {
|
||||
);
|
||||
}
|
||||
|
||||
function isObject(obj: unknown) {
|
||||
function isConvertableObject(obj: unknown) {
|
||||
return (
|
||||
obj === Object(obj) && !Array.isArray(obj) && typeof obj !== "function"
|
||||
obj === Object(obj) && !Array.isArray(obj) && typeof obj !== "function" &&
|
||||
!(obj instanceof Blob)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ export function camelKeysToSnakeCase<T>(
|
||||
// deno-lint-ignore no-explicit-any
|
||||
obj: Record<string, any> | Record<string, any>[],
|
||||
): T {
|
||||
if (isObject(obj)) {
|
||||
if (isConvertableObject(obj)) {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const convertedObject: Record<string, any> = {};
|
||||
|
||||
@@ -88,7 +89,7 @@ export function snakeKeysToCamelCase<T>(
|
||||
// deno-lint-ignore no-explicit-any
|
||||
obj: Record<string, any> | Record<string, any>[],
|
||||
): T {
|
||||
if (isObject(obj)) {
|
||||
if (isConvertableObject(obj)) {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const convertedObject: Record<string, any> = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user