fix: fix credential 3rd error
This commit is contained in:
@@ -13,3 +13,23 @@ export function arkValidatorToTypeNarrower<
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
export function validateOr<T, D>(
|
||||
validated: T | ArkErrors,
|
||||
defaultValue: D
|
||||
): T | D {
|
||||
if (validated instanceof ArkErrors) {
|
||||
return defaultValue;
|
||||
}
|
||||
return validated;
|
||||
}
|
||||
|
||||
export function validateOrElse<T, D>(
|
||||
validated: T | ArkErrors,
|
||||
elseFn: (errors: ArkErrors) => D
|
||||
): T | D {
|
||||
if (validated instanceof ArkErrors) {
|
||||
return elseFn(validated);
|
||||
}
|
||||
return validated;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { type } from 'arktype';
|
||||
import {
|
||||
BookOpen,
|
||||
Folders,
|
||||
@@ -112,3 +113,15 @@ export const AppNavMainData = [
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const CreateCompleteAction = {
|
||||
Back: 'back',
|
||||
Detail: 'detail',
|
||||
} as const;
|
||||
|
||||
export type CreateCompleteAction =
|
||||
(typeof CreateCompleteAction)[keyof typeof CreateCompleteAction];
|
||||
|
||||
export const CreateCompleteActionSchema = type.enumerated(
|
||||
...Object.values(CreateCompleteAction)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user