(obj: any)
| 11 | } |
| 12 | |
| 13 | export function camelize(obj: any): any { |
| 14 | if (Array.isArray(obj)) { |
| 15 | return obj.map(value => camelize(value)); |
| 16 | } else if (obj !== null && obj.constructor === Object) { |
| 17 | return Object.keys(obj).reduce((result, key: string) => ({ |
| 18 | ...result, |
| 19 | [snakeToCamel(key)]: camelize(obj[key]) |
| 20 | }), {}, |
| 21 | ); |
| 22 | } |
| 23 | return obj; |
| 24 | } |
| 25 | |
| 26 | export function sortUnique<T>(arr: Array<T>, comparator: (a: T, b: T) => number, |
| 27 | equals: (a: T, b: T) => boolean): Array<T> { |
no test coverage detected