Closed rdandnayak closed 4 years ago
Duplicate of #20
Alternative function for Frontend projects:
function pascalToCamelCase(input) {
let output, inputKey, outputKey, value;
if (input instanceof Array) {
return input.map((v) => (typeof v === 'object' ? pascalToCamelCase(v) : v));
} else {
output = {};
for (inputKey in input) {
if (input.hasOwnProperty(inputKey)) {
outputKey = (
inputKey.charAt(0).toLowerCase() + inputKey.slice(1) ||
inputKey
).toString();
value = input[inputKey];
if (
value instanceof Array ||
(value !== null && value.constructor === Object)
) {
value = pascalToCamelCase(value);
}
output[outputKey] = value;
}
}
}
return output;
}
export default pascalToCamelCase;
while running an angular project i face this problem
and the reason is
seems like Arrow functions are not understandable by IE11