@paritydeals/node-sdk
Version:
Node.js SDK for interacting with the ParityDeals API.
25 lines • 1.16 kB
TypeScript
/**
* Converts a camelCase or PascalCase string to snake_case.
* Examples:
* toSnakeCase("helloWorld") // "hello_world"
* toSnakeCase("HelloWorld") // "hello_world"
* toSnakeCase("CustomerID") // "customer_id"
* toSnakeCase("IPAddress") // "ip_address"
* @param str The string to convert.
* @returns The snake_cased string.
*/
export declare function toSnakeCase(str: string): string;
/**
* Recursively converts all keys of an object (and its nested objects/arrays) from camelCase to snake_case.
* @param obj The object or array to transform.
* @returns A new object or array with snake_case keys.
*/
export declare function keysToSnakeCase(obj: any): any;
/**
* Converts object keys for query parameters to snake_case and filters out null or undefined values.
* This is useful for preparing objects to be used as query parameters.
* @param params The parameters object (keys typically in camelCase).
* @returns A new object with snake_case keys and only defined (non-null, non-undefined) values.
*/
export declare function prepareSnakeCaseParams(params: Record<string, any>): Record<string, any>;
//# sourceMappingURL=utils.d.ts.map