diff options
Diffstat (limited to 'src/helpers')
-rw-r--r-- | src/helpers/array-helpers.ts | 11 | ||||
-rw-r--r-- | src/helpers/async-helpers.ts | 2 | ||||
-rw-r--r-- | src/helpers/routing-helpers.ts | 5 |
3 files changed, 10 insertions, 8 deletions
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 @@ | |||
1 | export const shuffleArray = (arr: any[]): any[] => | 1 | export default function shuffleArray(arr: any[]): any[] { |
2 | arr | 2 | return arr |
3 | .map(a => [Math.random(), a]) | 3 | .map(a => [ Math.random(), a ]) |
4 | .sort((a, b) => a[0] - b[0]) | 4 | .sort((a, b) => a[ 0 ] - b[ 0 ]) |
5 | .map(a => a[1]); | 5 | .map(a => a[ 1 ]) |
6 | }; | ||
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 @@ | |||
1 | export function sleep(ms: number = 0): Promise<void> { | 1 | export default function sleep(ms: number = 0): Promise<void> { |
2 | // eslint-disable-next-line no-promise-executor-return | 2 | // eslint-disable-next-line no-promise-executor-return |
3 | return new Promise(r => setTimeout(r, ms)); | 3 | return new Promise(r => setTimeout(r, ms)); |
4 | } | 4 | } |
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 @@ | |||
1 | import RouteParser from 'route-parser'; | 1 | import RouteParser from 'route-parser'; |
2 | 2 | ||
3 | export const matchRoute = (pattern: string, path: string) => | 3 | export default function matchRoute(pattern: string, path: string) { |
4 | new RouteParser(pattern).match(path); | 4 | return new RouteParser(pattern).match(path); |
5 | } | ||