From 7ac45f1d86742df57e5424afb35a5d3fd75ea9c5 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Thu, 30 Mar 2023 19:13:30 +0300 Subject: [PATCH] tslint errors fix --- src/data/camelizer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/camelizer.ts b/src/data/camelizer.ts index e9fc060..96987a2 100644 --- a/src/data/camelizer.ts +++ b/src/data/camelizer.ts @@ -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 };