Skip to content

Commit

Permalink
fix: return array lowercase fn
Browse files Browse the repository at this point in the history
* fix: return array lowercase fn

* bump version

---------

Co-authored-by: Mohammed Izzy <[email protected]>
  • Loading branch information
mohdizzy and Mohammed Izzy authored Oct 24, 2024
1 parent 842525a commit d018758
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless-guru/logger",
"version": "1.0.3",
"version": "1.0.4",
"description": "Common logger utility",
"main": "./lib/cjs/index.js",
"types": "./lib/cjs/index.d.ts",
Expand Down
9 changes: 2 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,8 @@ class Logger {
const arrayToLowerCase = (array: StringArray): StringArray => {
if (Array.isArray(array)) {
return array
.map((el) => {
if (typeof el === "string") {
return el.toLowerCase();
}
return undefined;
})
.filter((el) => typeof el !== "undefined");
.filter((el) => typeof el === "string")
.map((el) => el.toLowerCase());
}
return [];
};
Expand Down

0 comments on commit d018758

Please sign in to comment.