export class CamelCase {
    public static convertKeysToCamelCase(key: string, value: any) {
        if (value && typeof value === 'object') {
            for (var k in value) {
                if (/^[A-Z]/.test(k) && Object.hasOwnProperty.call(value, k)) {
                    value[this.toCamelCase(k)] = value[k];
                    delete value[k];
                }
            }
        }
        return value;
    }
    public static toCamelCase(key: string): string {
        if (key != null && key.length > 0) {
            let camelCased: string = key.charAt(0).toLowerCase();
            if (key.length > 1) {
                camelCased += key.substring(1);
            }
            return camelCased;
        }
        return key;
    }
}