casbin 5.13.0 → 5.13.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [5.13.1](https://github.com/casbin/node-casbin/compare/v5.13.0...v5.13.1) (2022-02-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 'eval' not detected ([86e2add](https://github.com/casbin/node-casbin/commit/86e2add7c5aaa7901d21c1c4b9cb8e6d0b8bef75))
7
+ * created two regex expressions ([de5f2f4](https://github.com/casbin/node-casbin/commit/de5f2f4f27f40941b125bf068b8f90e44ba69fb1))
8
+
1
9
  # [5.13.0](https://github.com/casbin/node-casbin/compare/v5.12.0...v5.13.0) (2022-01-25)
2
10
 
3
11
 
@@ -103,7 +103,8 @@ function writeFile(path, file, encoding) {
103
103
  });
104
104
  }
105
105
  exports.writeFile = writeFile;
106
- const evalReg = new RegExp(/\beval\(([^),]*)\)/g);
106
+ const evalRegG = new RegExp(/\beval\(([^),]*)\)/g);
107
+ const evalReg = new RegExp(/\beval\(([^),]*)\)/);
107
108
  // hasEval determine whether matcher contains function eval
108
109
  function hasEval(s) {
109
110
  return evalReg.test(s);
@@ -116,7 +117,7 @@ function replaceEval(s, ruleName, rule) {
116
117
  exports.replaceEval = replaceEval;
117
118
  // getEvalValue returns the parameters of function eval
118
119
  function getEvalValue(s) {
119
- const subMatch = s.match(evalReg);
120
+ const subMatch = s.match(evalRegG);
120
121
  const rules = [];
121
122
  if (!subMatch) {
122
123
  return [];
@@ -90,7 +90,8 @@ function writeFile(path, file, encoding) {
90
90
  });
91
91
  });
92
92
  }
93
- const evalReg = new RegExp(/\beval\(([^),]*)\)/g);
93
+ const evalRegG = new RegExp(/\beval\(([^),]*)\)/g);
94
+ const evalReg = new RegExp(/\beval\(([^),]*)\)/);
94
95
  // hasEval determine whether matcher contains function eval
95
96
  function hasEval(s) {
96
97
  return evalReg.test(s);
@@ -101,7 +102,7 @@ function replaceEval(s, ruleName, rule) {
101
102
  }
102
103
  // getEvalValue returns the parameters of function eval
103
104
  function getEvalValue(s) {
104
- const subMatch = s.match(evalReg);
105
+ const subMatch = s.match(evalRegG);
105
106
  const rules = [];
106
107
  if (!subMatch) {
107
108
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casbin",
3
- "version": "5.13.0",
3
+ "version": "5.13.1",
4
4
  "description": "An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS",
5
5
  "main": "lib/cjs/index.js",
6
6
  "typings": "lib/cjs/index.d.ts",