mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
16 lines
535 B
TypeScript
16 lines
535 B
TypeScript
import * as yup from 'yup';
|
|
import { urlTest } from '../../utils';
|
|
|
|
export const userOpsSchema = yup
|
|
.object()
|
|
.shape({
|
|
NEXT_PUBLIC_HAS_USER_OPS: yup.boolean(),
|
|
NEXT_PUBLIC_USER_OPS_INDEXER_API_HOST: yup
|
|
.string()
|
|
.test(urlTest)
|
|
.when('NEXT_PUBLIC_HAS_USER_OPS', {
|
|
is: (value: boolean) => value,
|
|
then: (schema) => schema,
|
|
otherwise: (schema) => schema.max(-1, 'NEXT_PUBLIC_USER_OPS_INDEXER_API_HOST can only be used if NEXT_PUBLIC_HAS_USER_OPS is set to \'true\''),
|
|
}),
|
|
}); |