Skip to content

Commit

Permalink
Clean up arrayWrap
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth committed Aug 23, 2023
1 parent f334261 commit 72d55c1
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions grai-frontend/src/helpers/arrayWrap.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
const arrayWrap = <T>(value: T | T[]): T[] =>
Array.isArray(value) ? value : [value]

export const arrayWrapDefault = <T>(
value: T | NonNullable<T>[] | undefined,
defaultValue: NonNullable<T>[] = [],
): NonNullable<T>[] => (value ? arrayWrap(value) : defaultValue)

export default arrayWrap

0 comments on commit 72d55c1

Please sign in to comment.