Use zod instead of yup (#2254)

* use zod instead of yup

* doc

* lint
This commit is contained in:
brendanlaschke
2023-10-27 10:26:32 +02:00
committed by GitHub
parent c04e866de3
commit 6a72c14af3
19 changed files with 61 additions and 67 deletions

View File

@ -2,7 +2,7 @@ import { isBoolean } from '@sniptt/guards';
import { FieldBooleanValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldBooleanValue = (
fieldValue: unknown,
): fieldValue is FieldBooleanValue => isBoolean(fieldValue);

View File

@ -2,7 +2,7 @@ import { isString } from '@sniptt/guards';
import { FieldChipValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldChipValue = (
fieldValue: unknown,
): fieldValue is FieldChipValue => isString(fieldValue);

View File

@ -2,7 +2,7 @@ import { isNull, isString } from '@sniptt/guards';
import { FieldDateValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldDateValue = (
fieldValue: unknown,
): fieldValue is FieldDateValue => isNull(fieldValue) || isString(fieldValue);

View File

@ -1,7 +1,7 @@
import { FieldDoubleTextValue } from '../FieldMetadata';
import { DoubleTextTypeResolver } from '../resolvers/DoubleTextTypeResolver';
// TODO: add yup
// TODO: add zod
export const isFieldDoubleTextValue = (
fieldValue: unknown,
): fieldValue is FieldDoubleTextValue =>

View File

@ -2,7 +2,7 @@ import { isString } from '@sniptt/guards';
import { FieldEmailValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldEmailValue = (
fieldValue: unknown,
): fieldValue is FieldEmailValue => isString(fieldValue);

View File

@ -2,7 +2,7 @@ import { isNull, isNumber } from '@sniptt/guards';
import { FieldMoneyValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldMoneyValue = (
fieldValue: unknown,
): fieldValue is FieldMoneyValue => isNull(fieldValue) || isNumber(fieldValue);

View File

@ -2,7 +2,7 @@ import { isNull, isNumber } from '@sniptt/guards';
import { FieldNumberValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldNumberValue = (
fieldValue: unknown,
): fieldValue is FieldNumberValue => isNull(fieldValue) || isNumber(fieldValue);

View File

@ -2,7 +2,7 @@ import { isString } from '@sniptt/guards';
import { FieldPhoneValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldPhoneValue = (
fieldValue: unknown,
): fieldValue is FieldPhoneValue => isString(fieldValue);

View File

@ -2,7 +2,7 @@ import { isNumber } from '@sniptt/guards';
import { FieldProbabilityValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldProbabilityValue = (
fieldValue: unknown,
): fieldValue is FieldProbabilityValue => isNumber(fieldValue);

View File

@ -2,7 +2,7 @@ import { isNull, isObject, isUndefined } from '@sniptt/guards';
import { FieldRelationValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldRelationValue = (
fieldValue: unknown,
): fieldValue is FieldRelationValue =>

View File

@ -2,7 +2,7 @@ import { isString } from '@sniptt/guards';
import { FieldTextValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldTextValue = (
fieldValue: unknown,
): fieldValue is FieldTextValue => isString(fieldValue);

View File

@ -7,7 +7,7 @@ const urlV2Schema = z.object({
text: z.string(),
});
// TODO: add yup
// TODO: add zod
export const isFieldURLV2Value = (
fieldValue: unknown,
): fieldValue is FieldURLV2Value => urlV2Schema.safeParse(fieldValue).success;

View File

@ -2,7 +2,7 @@ import { isString } from '@sniptt/guards';
import { FieldURLValue } from '../FieldMetadata';
// TODO: add yup
// TODO: add zod
export const isFieldURLValue = (
fieldValue: unknown,
): fieldValue is FieldURLValue => isString(fieldValue);