UNPKG

prisma-criteria

Version:

Parses, validates, and creates a criteria object that can be passed to the Prisma "findMany" method to query a list of resources matching the given filters, pagination and order.

12 lines 583 B
import { PRISMA_OPERATORS_BY_GROUP } from './consts.js'; export const checkScalarOperator = (filterProspect, expectedType) => { if (filterProspect.operator === undefined) return false; if (!(expectedType in PRISMA_OPERATORS_BY_GROUP.types)) return false; const scalarOperatorsAccordingToExpectedType = Object.values(PRISMA_OPERATORS_BY_GROUP.types[expectedType]); const isValidOperator = scalarOperatorsAccordingToExpectedType .includes(filterProspect.operator); return isValidOperator; }; //# sourceMappingURL=scalar-operator-check.js.map