UNPKG

naming-conventions-modeler

Version:
32 lines (31 loc) 1.25 kB
export type NamingConvention = 'snake_case' | 'camelCase' | 'PascalCase' | 'kebab-case' | 'MACRO_CASE' | 'Train-Case' | 'flatcase' | 'no case'; /** * It takes a JSON object and a lookup table, and returns a new JSON object with the keys in the lookup * table replaced with their corresponding values * * @param {any} data - The data to be translated. * @param table - The table of replacements. * * @returns A function that takes two arguments, data and table, and returns a new object. */ export declare const lookup: <T = any>(data: any, table: { [x: string]: string; }) => T; export declare class Modeler { /** * It takes an object and a naming convention and returns a new object with the same properties but * with the naming convention applied * * @param {object} data - The data object that you want to convert. * @param {NamingConvention} name - NamingConvention * * @returns The return value is the result of the nested function. */ static build<T = any>(data: any, name: NamingConvention): T; /** * It takes an convention model and converts all properties * * @param {object} data - The data to be converted. */ static convert<T = any>(data: any): T; }