Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cerbos/orm-prisma

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerbos/orm-prisma - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/cjs/index.test.d.ts

34

lib/cjs/index.js

@@ -28,2 +28,8 @@ "use strict";

}
function getOperandName(operands) {
return (operands.find(o => o.hasOwnProperty("name"))).name;
}
function getOperandValue(operands) {
return (operands.find(o => o.hasOwnProperty("value"))).value;
}
function mapOperand(operand, getFieldName, output = {}) {

@@ -40,34 +46,34 @@ if (isExpression(operand)) {

case "eq":
output[getFieldName(operands[0].name)] = {
equals: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
equals: getOperandValue(operands),
};
break;
case "ne":
output[getFieldName(operands[0].name)] = {
not: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
not: getOperandValue(operands),
};
break;
case "lt":
output[getFieldName(operands[0].name)] = {
lt: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
lt: getOperandValue(operands),
};
break;
case "gt":
output[getFieldName(operands[0].name)] = {
gt: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
gt: getOperandValue(operands),
};
break;
case "lte":
output[getFieldName(operands[0].name)] = {
lte: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
lte: getOperandValue(operands),
};
break;
case "gte":
output[getFieldName(operands[0].name)] = {
gte: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
gte: getOperandValue(operands),
};
break;
case "in":
output[getFieldName(operands[0].name)] = {
in: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
in: getOperandValue(operands),
};

@@ -74,0 +80,0 @@ break;

@@ -25,2 +25,8 @@ import { PlanKind } from "@cerbos/core";

}
function getOperandName(operands) {
return (operands.find(o => o.hasOwnProperty("name"))).name;
}
function getOperandValue(operands) {
return (operands.find(o => o.hasOwnProperty("value"))).value;
}
function mapOperand(operand, getFieldName, output = {}) {

@@ -37,34 +43,34 @@ if (isExpression(operand)) {

case "eq":
output[getFieldName(operands[0].name)] = {
equals: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
equals: getOperandValue(operands),
};
break;
case "ne":
output[getFieldName(operands[0].name)] = {
not: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
not: getOperandValue(operands),
};
break;
case "lt":
output[getFieldName(operands[0].name)] = {
lt: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
lt: getOperandValue(operands),
};
break;
case "gt":
output[getFieldName(operands[0].name)] = {
gt: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
gt: getOperandValue(operands),
};
break;
case "lte":
output[getFieldName(operands[0].name)] = {
lte: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
lte: getOperandValue(operands),
};
break;
case "gte":
output[getFieldName(operands[0].name)] = {
gte: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
gte: getOperandValue(operands),
};
break;
case "in":
output[getFieldName(operands[0].name)] = {
in: operands[1].value,
output[getFieldName(getOperandName(operands))] = {
in: getOperandValue(operands),
};

@@ -71,0 +77,0 @@ break;

{
"name": "@cerbos/orm-prisma",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://cerbos.dev",

@@ -17,3 +17,4 @@ "description": "",

"version": "git add -A src",
"postversion": "git push && git push --tags"
"postversion": "git push && git push --tags",
"test": "jest src/**.test.ts"
},

@@ -23,2 +24,4 @@ "author": "Cerbos",

"devDependencies": {
"@types/jest": "^29.0.0",
"ts-jest": "^28.0.8",
"ts-node": "^10.4.0",

@@ -28,4 +31,4 @@ "typescript": "^4.5.4"

"dependencies": {
"@cerbos/core": "^0.5.0"
"@cerbos/core": "^0.5.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc