Repository URL to install this package:
|
Version:
1.0.10 ▾
|
/**
* @desc remap properties from 1 to another, for example, apis with inconsistent naming
* @symb 🗺
*
* @param from property name string, or {[from]: to}
* @param [to=undefined] property name to change key to
*
* @example
* const disToDat = remap({dis: 'dat'})
* disToDat({dis: 1, other: true})
* //=> {dist: 1, other: true}
*
*/
export interface RemapAnyObjDefault {
[key: string]: any;
}
declare function remap<Props extends {} = RemapAnyObjDefault>(from: object | string, to: string): (props: Props) => Props;
export { remap };
export { remap as remapProps };
export default remap;