add number typeof (#146)

* fix

* fix

* update version

* fix helpers

* fix

* update version

* add number typeof

* accept auth option
This commit is contained in:
MARCROCK22 2023-08-13 20:22:46 -04:00 committed by GitHub
parent 20dc37d9e3
commit 03bd41caea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -59,6 +59,7 @@ export function toSnakeCase<Obj extends Record<string, any>>(target: Obj): Objec
case "bigint":
case "boolean":
case "function":
case "number":
case "symbol":
case "undefined":
result[ReplaceRegex.snake(key)] = value;
@ -97,6 +98,7 @@ export function toCamelCase<Obj extends Record<string, any>>(target: Obj): Objec
case "boolean":
case "function":
case "symbol":
case "number":
case "undefined":
result[ReplaceRegex.camel(key)] = value;
break;

View File

@ -2,6 +2,7 @@ import type { RawFile, RequestData } from '@discordjs/rest';
import { REST } from '@discordjs/rest';
import type { Identify } from '@biscuitland/common';
import type { RequestMethod } from './Router';
import { Routes } from './Routes';
export class BiscuitREST {
api: REST;
constructor(public options: BiscuitRESTOptions) {
@ -63,7 +64,7 @@ export class BiscuitREST {
export type BiscuitRESTOptions = Identify<ConstructorParameters<typeof REST>[0] & { token: string }>;
export type RequestOptions = Pick<RequestData, 'passThroughBody' | 'reason'>;
export type RequestOptions = Pick<RequestData, 'passThroughBody' | 'reason' | 'auth'>;
export type RequestObject<M extends RequestMethod, B = Record<string, any>, Q = Record<string, any>> = {
query?: Q;