prisma-guard 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1120,7 +1120,7 @@ function collectEqualityFields(where, model, typeMap) {
1120
1120
  continue;
1121
1121
  if (!value || !isPlainObject(value))
1122
1122
  continue;
1123
- if (Object.keys(value).every((op) => op === "equals")) {
1123
+ if ("equals" in value) {
1124
1124
  fields.add(key);
1125
1125
  }
1126
1126
  }
@@ -1451,6 +1451,13 @@ function createWhereBuilder(typeMap, enumMap, scalarBase) {
1451
1451
  }
1452
1452
  }
1453
1453
  function processScalarField(fieldName, operators, model, fieldMeta, fieldSchemas, scalarConditions) {
1454
+ if (operators === true) {
1455
+ const supportedOps = getSupportedOperators(fieldMeta);
1456
+ const expanded = {};
1457
+ for (const op of supportedOps)
1458
+ expanded[op] = true;
1459
+ operators = expanded;
1460
+ }
1454
1461
  if (!isPlainObject(operators)) {
1455
1462
  throw new ShapeError(
1456
1463
  `Where config for scalar field "${fieldName}" on model "${model}" must be an object of operators`