Files
documenso/packages/prisma/guards/is-signature-field.ts
2023-11-06 13:01:09 +11:00

10 lines
363 B
TypeScript

import { FieldType } from '@prisma/client';
const SignatureFieldTypes = [FieldType.SIGNATURE, FieldType.FREE_SIGNATURE] as const;
type SignatureFieldType = (typeof SignatureFieldTypes)[number];
export const isSignatureFieldType = (type: FieldType): type is SignatureFieldType => {
return type === FieldType.SIGNATURE || type === FieldType.FREE_SIGNATURE;
};