prisma-guard 1.18.1 → 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.
package/dist/runtime/index.js
CHANGED
|
@@ -1087,13 +1087,9 @@ function collectEqualityFields(where, model, typeMap) {
|
|
|
1087
1087
|
continue;
|
|
1088
1088
|
if (typeMap && model && typeMap[model]?.[key]?.isRelation)
|
|
1089
1089
|
continue;
|
|
1090
|
-
if (value !== null && value !== void 0 && !isPlainObject(value) && !Array.isArray(value)) {
|
|
1091
|
-
fields.add(key);
|
|
1092
|
-
continue;
|
|
1093
|
-
}
|
|
1094
1090
|
if (!value || !isPlainObject(value))
|
|
1095
1091
|
continue;
|
|
1096
|
-
if (
|
|
1092
|
+
if ("equals" in value) {
|
|
1097
1093
|
fields.add(key);
|
|
1098
1094
|
}
|
|
1099
1095
|
}
|
|
@@ -1424,6 +1420,13 @@ function createWhereBuilder(typeMap, enumMap, scalarBase) {
|
|
|
1424
1420
|
}
|
|
1425
1421
|
}
|
|
1426
1422
|
function processScalarField(fieldName, operators, model, fieldMeta, fieldSchemas, scalarConditions) {
|
|
1423
|
+
if (operators === true) {
|
|
1424
|
+
const supportedOps = getSupportedOperators(fieldMeta);
|
|
1425
|
+
const expanded = {};
|
|
1426
|
+
for (const op of supportedOps)
|
|
1427
|
+
expanded[op] = true;
|
|
1428
|
+
operators = expanded;
|
|
1429
|
+
}
|
|
1427
1430
|
if (!isPlainObject(operators)) {
|
|
1428
1431
|
throw new ShapeError(
|
|
1429
1432
|
`Where config for scalar field "${fieldName}" on model "${model}" must be an object of operators`
|