Skip to content

Commit

Permalink
Fix enum util
Browse files Browse the repository at this point in the history
  • Loading branch information
kamarmack committed Dec 30, 2023
1 parent ecb8484 commit a0d7d21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions typescript-helpers/enum-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export const getEnum = <K extends string>(
isMember: _isTsEnumMember(arr),
obj,
regex: _getEnumRegex(arr),
toDefinedSchemaWithDefault: () =>
getDefinedSchemaWithDefault: () =>
yup.mixed<K>().oneOf(arr).default(defaultValue),
toDefinedSchema: () => yup.mixed<K>().oneOf(arr).defined(),
toOptionalSchema: () => yup.mixed<K>().oneOf(arr),
getDefinedSchema: () => yup.mixed<K>().oneOf(arr).defined(),
getOptionalSchema: () => yup.mixed<K>().oneOf(arr),
} as const;
};
export type TsEnumType<K extends string> = ReturnType<typeof getEnum> &
Expand Down

0 comments on commit a0d7d21

Please sign in to comment.