Skip to content

Commit 853ef05

Browse files
committed
refactor: improve code
1 parent 2aa1db3 commit 853ef05

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/formatDateTime/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ type FormatPattern = DateTimeFormat | string;
121121
*/
122122
export const formatDateTime = (
123123
date: DateTimeInput,
124-
format: FormatPattern
124+
format: FormatPattern = DateTimeFormat.STANDARD
125125
): string | dayjs.Dayjs => {
126126
const isValidFormat = Object.values<string>(DateTimeFormat).includes(format);
127127

src/getQueryParameters/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const getQueryParameters = <T extends Record<string, string | null | undefined>>
4242
const searchParams = new URLSearchParams(search);
4343
const paramValue = {};
4444

45-
for (const [key, value] of searchParams.entries()) {
45+
searchParams.forEach((value, key) => {
4646
if (value === 'null') {
4747
paramValue[key] = null;
4848
} else if (value === 'undefined') {
@@ -54,7 +54,7 @@ const getQueryParameters = <T extends Record<string, string | null | undefined>>
5454
paramValue[key] = value;
5555
}
5656
}
57-
}
57+
});
5858

5959
return paramValue as T;
6060
};

0 commit comments

Comments
 (0)