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 +8 -0
- package/lib/cjs/util/util.js +3 -2
- package/lib/esm/util/util.js +3 -2
- package/package.json +1 -1
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
|
|
package/lib/cjs/util/util.js
CHANGED
|
@@ -103,7 +103,8 @@ function writeFile(path, file, encoding) {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
exports.writeFile = writeFile;
|
|
106
|
-
const
|
|
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(
|
|
120
|
+
const subMatch = s.match(evalRegG);
|
|
120
121
|
const rules = [];
|
|
121
122
|
if (!subMatch) {
|
|
122
123
|
return [];
|
package/lib/esm/util/util.js
CHANGED
|
@@ -90,7 +90,8 @@ function writeFile(path, file, encoding) {
|
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
const
|
|
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(
|
|
105
|
+
const subMatch = s.match(evalRegG);
|
|
105
106
|
const rules = [];
|
|
106
107
|
if (!subMatch) {
|
|
107
108
|
return [];
|
package/package.json
CHANGED