tslint errors fix

master
Tudor Stanciu 2023-03-30 19:13:30 +03:00
parent ea62905a56
commit 7ac45f1d86
1 changed files with 5 additions and 5 deletions

View File

@ -4,11 +4,11 @@ interface ObjectWithAnyKey {
[key: string]: any;
}
function camelizeKeys(o: any): any {
const camelizeKeys = (o: any): any => {
if (!o || (typeof o !== "object" && !Array.isArray(o))) return o;
let newO, value;
let newO;
if (o instanceof Array) {
return o.map(function (value) {
return o.map(value => {
if (typeof value === "object") {
value = camelizeKeys(value);
}
@ -21,7 +21,7 @@ function camelizeKeys(o: any): any {
const newKey = (
origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey
).toString();
value = o[origKey];
let value = o[origKey];
if (
value instanceof Array ||
(value !== null && value.constructor === Object)
@ -33,6 +33,6 @@ function camelizeKeys(o: any): any {
}
}
return newO;
}
};
export { camelizeKeys };