From d16cc1f2c59818e53f28b4d6b4d27250331f15d7 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 2 Jul 2022 05:13:38 +0530 Subject: Use default exports instead of named exports --- src/helpers/array-helpers.ts | 11 ++++++----- src/helpers/async-helpers.ts | 2 +- src/helpers/routing-helpers.ts | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/array-helpers.ts b/src/helpers/array-helpers.ts index 45ff932ba..5d28af433 100644 --- a/src/helpers/array-helpers.ts +++ b/src/helpers/array-helpers.ts @@ -1,5 +1,6 @@ -export const shuffleArray = (arr: any[]): any[] => - arr - .map(a => [Math.random(), a]) - .sort((a, b) => a[0] - b[0]) - .map(a => a[1]); +export default function shuffleArray(arr: any[]): any[] { + return arr + .map(a => [ Math.random(), a ]) + .sort((a, b) => a[ 0 ] - b[ 0 ]) + .map(a => a[ 1 ]) +}; diff --git a/src/helpers/async-helpers.ts b/src/helpers/async-helpers.ts index 6556a0141..de20ea080 100644 --- a/src/helpers/async-helpers.ts +++ b/src/helpers/async-helpers.ts @@ -1,4 +1,4 @@ -export function sleep(ms: number = 0): Promise { +export default function sleep(ms: number = 0): Promise { // eslint-disable-next-line no-promise-executor-return return new Promise(r => setTimeout(r, ms)); } diff --git a/src/helpers/routing-helpers.ts b/src/helpers/routing-helpers.ts index 46895aa6b..0b9a83df6 100644 --- a/src/helpers/routing-helpers.ts +++ b/src/helpers/routing-helpers.ts @@ -1,4 +1,5 @@ import RouteParser from 'route-parser'; -export const matchRoute = (pattern: string, path: string) => - new RouteParser(pattern).match(path); +export default function matchRoute(pattern: string, path: string) { + return new RouteParser(pattern).match(path); +} -- cgit v1.2.3-54-g00ecf