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.cjs
CHANGED
|
@@ -1118,13 +1118,9 @@ function collectEqualityFields(where, model, typeMap) {
|
|
|
1118
1118
|
continue;
|
|
1119
1119
|
if (typeMap && model && typeMap[model]?.[key]?.isRelation)
|
|
1120
1120
|
continue;
|
|
1121
|
-
if (value !== null && value !== void 0 && !isPlainObject(value) && !Array.isArray(value)) {
|
|
1122
|
-
fields.add(key);
|
|
1123
|
-
continue;
|
|
1124
|
-
}
|
|
1125
1121
|
if (!value || !isPlainObject(value))
|
|
1126
1122
|
continue;
|
|
1127
|
-
if (
|
|
1123
|
+
if ("equals" in value) {
|
|
1128
1124
|
fields.add(key);
|
|
1129
1125
|
}
|
|
1130
1126
|
}
|
|
@@ -1455,6 +1451,13 @@ function createWhereBuilder(typeMap, enumMap, scalarBase) {
|
|
|
1455
1451
|
}
|
|
1456
1452
|
}
|
|
1457
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
|
+
}
|
|
1458
1461
|
if (!isPlainObject(operators)) {
|
|
1459
1462
|
throw new ShapeError(
|
|
1460
1463
|
`Where config for scalar field "${fieldName}" on model "${model}" must be an object of operators`
|