Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/persist/helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Model } from '../model';
import * as parse from 'csv-parse/lib/sync';
import parse from 'csv-parse/lib/sync';

export class Helper {
public static loadPolicyLine(line: string, model: Model): void {
Expand Down
4 changes: 2 additions & 2 deletions src/util/builtinOperators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import * as rbac from '../rbac';
import { ip } from './ip';
import * as picomatch from 'picomatch';
import { isMatch } from 'picomatch';

// regexMatch determines whether key1 matches the pattern of key2 in regular expression.
function regexMatch(key1: string, key2: string): boolean {
Expand Down Expand Up @@ -305,7 +305,7 @@ function ipMatchFunc(...args: any[]): boolean {
* ```
*/
function globMatch(string: string, pattern: string): boolean {
return picomatch(pattern)(string);
return isMatch(string, pattern);
}

// generateGFunction is the factory method of the g(_, _) function.
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"strictPropertyInitialization": false,
"declaration": true,
"downlevelIteration": true,
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"include": ["src/**/*"]
}