Skip to content

Commit a4b91bb

Browse files
committed
feat: allow custom RegExp pattern
1 parent 4e98a6f commit a4b91bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default function (str, loose) {
2-
var c, o, tmp, ext, keys=[], pattern='', arr=str.split('/');
2+
if (str instanceof RegExp) return { keys:false, pattern:str };
3+
var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/');
34
arr[0] || arr.shift();
45

56
while (tmp = arr.shift()) {

0 commit comments

Comments
 (0)