Skip to content

Commit

Permalink
style: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Oct 10, 2024
1 parent c20ef4e commit b7af2cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/lib/form/label.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import i18n from '@dhis2/d2-i18n'

/**
* Utility function to get the required label.
*
* Note that label should already be translated
*/
export const getRequiredLabel = (label: string) => {
return i18n.t('{{label}} (required)', { label })
}
Empty file added src/lib/localStorage/index.ts
Empty file.
2 changes: 1 addition & 1 deletion src/lib/zod/getDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type WrapNonDefaultsInOptional<T extends z.ZodTypeAny> = T extends z.ZodEffects<
// added some type-improvements
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getDefaults<T extends z.AnyZodObject | z.ZodEffects<any>>(
schema: T //z.AnyZodObject | z.ZodEffects<any>
schema: T
): z.infer<WrapNonDefaultsInOptional<T>> {
// Check if it's a ZodEffect
if (schema instanceof z.ZodEffects) {
Expand Down

0 comments on commit b7af2cd

Please sign in to comment.