Skip to content

Commit

Permalink
Update helpers.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Jul 17, 2024
1 parent faf5e0d commit 21f90a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const assert = <T>(data: T) => {
return data as Exclude<T, number> extends never ? T : Exclude<T, number>
}

export const fallback = <T>(data: T, codes: number[]) => {
export const fallback = <T>(data: T, codes: number[] = [DOESNT_EXIST]) => {
if (typeof data === 'number' && data < 0) {
if (codes.includes(data)) {
return undefined as T extends true ? undefined : never
Expand Down

0 comments on commit 21f90a6

Please sign in to comment.