prisma-guard 1.26.1 → 1.26.2
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
|
@@ -5510,15 +5510,15 @@ function createModelGuardExtension(config) {
|
|
|
5510
5510
|
}
|
|
5511
5511
|
return wrapped;
|
|
5512
5512
|
}
|
|
5513
|
-
|
|
5514
|
-
|
|
5513
|
+
const extension = {};
|
|
5514
|
+
for (const modelName of Object.keys(typeMap)) {
|
|
5515
|
+
const key = toDelegateKey(modelName);
|
|
5516
|
+
extension[key] = {
|
|
5515
5517
|
guard(input, caller) {
|
|
5516
|
-
const
|
|
5517
|
-
const delegateKey = toDelegateKey(modelName);
|
|
5518
|
-
const modelDelegate = this.$parent[delegateKey];
|
|
5518
|
+
const modelDelegate = this.$parent[key];
|
|
5519
5519
|
if (!modelDelegate) {
|
|
5520
5520
|
throw new ShapeError(
|
|
5521
|
-
`Could not resolve Prisma delegate for model "${modelName}" (key: "${
|
|
5521
|
+
`Could not resolve Prisma delegate for model "${modelName}" (key: "${key}")`
|
|
5522
5522
|
);
|
|
5523
5523
|
}
|
|
5524
5524
|
const methods = createGuardedMethods(
|
|
@@ -5531,8 +5531,9 @@ function createModelGuardExtension(config) {
|
|
|
5531
5531
|
return methods;
|
|
5532
5532
|
return wrapMethods(methods);
|
|
5533
5533
|
}
|
|
5534
|
-
}
|
|
5535
|
-
}
|
|
5534
|
+
};
|
|
5535
|
+
}
|
|
5536
|
+
return extension;
|
|
5536
5537
|
}
|
|
5537
5538
|
|
|
5538
5539
|
// src/runtime/guard.ts
|