Skip to content

Commit

Permalink
fix: enable esModuleInterop support (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
  • Loading branch information
nodece authored Jun 22, 2022
1 parent d1747e7 commit 20db339
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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/**/*"]
}

0 comments on commit 20db339

Please sign in to comment.