mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 07:16:01 +00:00
prettier
This commit is contained in:
@@ -4,7 +4,7 @@ import _isString from 'lodash/isString';
|
||||
export function compilePermissions(permissions: string[] | string) {
|
||||
if (!permissions) return null;
|
||||
if (_isString(permissions)) permissions = permissions.split(',');
|
||||
return permissions.map((x) => new RegExp('^' + _escapeRegExp(x).replace(/\\\*/g, '.*') + '$'));
|
||||
return permissions.map(x => new RegExp('^' + _escapeRegExp(x).replace(/\\\*/g, '.*') + '$'));
|
||||
}
|
||||
|
||||
export function testPermission(tested: string, permissions: RegExp[]) {
|
||||
|
||||
Reference in New Issue
Block a user