Skip to content

Commit

Permalink
Merge pull request #64 from hariprasadiit/master
Browse files Browse the repository at this point in the history
fix: token parsing issues if token contains delimiter
  • Loading branch information
Zxilly authored Mar 21, 2022
2 parents ee3edd7 + d31166e commit a1bbdf4
Show file tree
Hide file tree
Showing 3 changed files with 4,007 additions and 4,098 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"build": "run-s clean && run-p build:*",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"clean": "rimraf lib"
"clean": "rimraf lib",
"prepare": "npm run build"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.21.0",
Expand All @@ -79,10 +80,10 @@
"typescript": "^4.2.3"
},
"dependencies": {
"mongoose": "^6.0.12"
"mongoose": "^6.2.4"
},
"peerDependencies": {
"casbin": "^5.0.7"
"casbin": "^5.13.2"
},
"husky": {
"hooks": {
Expand All @@ -100,4 +101,4 @@
"lcov"
]
}
}
}
3 changes: 2 additions & 1 deletion src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ export class MongooseAdapter implements BatchAdapter, FilteredAdapter, Updatable

for (const word of [line.v0, line.v1, line.v2, line.v3, line.v4, line.v5]) {
if (word !== undefined) {
lineText = `${lineText},${word}`
let wrappedWord = /^".*"$/.test(word) ? word : `"${word}"`;
lineText = `${lineText},${wrappedWord}`;
} else {
break
}
Expand Down
Loading

0 comments on commit a1bbdf4

Please sign in to comment.