File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/components/cylc/common Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ import {
2323 TaskStateNames ,
2424 WaitingStateModifierNames ,
2525} from '@/model/TaskState.model'
26+ import {
27+ escapeRegExp
28+ } from 'lodash-es'
2629
2730/* Convert a glob to a Regex.
2831 *
@@ -45,14 +48,12 @@ export function globToRegex (glob) {
4548 // prefix a space then subtract the first four characters (`\x20`)
4649 // from the result
4750 // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape
48- RegExp . escape ( ' ' + glob . trim ( ) )
49- . substr ( 4 )
50- // `*` -> `.*`
51+ escapeRegExp ( glob . trim ( ) )
5152 . replace ( / \\ \* / , '.*' )
5253 // `?` -> `.`
5354 . replace ( / \\ \? / , '.' )
5455 // `[!X]` -> `[^X]`
55- . replace ( / \\ \[ \\ x 2 1 ( [ ^ ] * ) \\ \] / , '[^$1]' )
56+ . replace ( / \\ \[ ! ( [ ^ ] * ) \\ \] / , '[^$1]' )
5657 // `[X]` -> `[X]`
5758 . replace ( / \\ \[ ( [ ^ ] * ) \\ \] / , '[$1]' )
5859 )
You can’t perform that action at this time.
0 commit comments