We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 043da05 commit 6a41f6dCopy full SHA for 6a41f6d
1 file changed
asyncPersistence.js
@@ -87,11 +87,15 @@ function longestCommonPrefix (patterns) {
87
}
88
89
function wildCardPosition (pattern) {
90
+ // return the first position of a wildcard or -1 if one is found
91
+ // if present wildcard_some is always the last character of the pattern
92
const oneIndex = pattern.indexOf(qlobberOpts.wildcard_one)
- const someIndex = pattern.indexOf(qlobberOpts.wildcard_some)
- if (oneIndex > someIndex) {
93
+ // we found oneIndex, so it must be the first one
94
+ if (oneIndex !== -1) {
95
return oneIndex
96
97
+ // check for one wildcard_some
98
+ const someIndex = pattern.indexOf(qlobberOpts.wildcard_some)
99
return someIndex
100
101
0 commit comments