UNPKG

keys-converter

Version:

This package provide a util function to convert snake case object keys to camel case

35 lines (34 loc) 774 B
/** * * @param obj `{ key: value }` * @returns obj `{ key: value }` * * * @argument Result type as Object interface to type the return * @argument Input type as Object interface to validate arguments type * @example * objectKeysToCamelCase<Result, Input>({}); * * @example * * interface Result { * goodMorning: string * goodAfternoon: string * } * * interface Input { * good_morning: string, * good_afternoon: string * } * * const result = objectKeysToCamelCase<Result, Input>( * { * good_morning: "Its a beautfull day", * good_afternoon: "Nice afternoon" * } * ); * */ declare const objectKeysToCamelCaseV2: <Result = {}, Input = {}>(obj: Input) => Result; export { objectKeysToCamelCaseV2 }; export default objectKeysToCamelCaseV2;