We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a39eee commit 35a15d5Copy full SHA for 35a15d5
src/index.ts
@@ -2,7 +2,7 @@ const DEFAULT_PREFIXES = "./";
2
const DEFAULT_DELIMITER = "/";
3
const GROUPS_RE = /\((?:\?<(.*?)>)?(?!\?)/g;
4
const NOOP_VALUE = (value: string) => value;
5
-const NAME_RE = /^[\p{L}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}]$/u;
+const NAME_RE = /^[\p{L}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}$]$/u;
6
7
/**
8
* Encode a string into another string.
@@ -130,13 +130,8 @@ function lexer(str: string) {
130
let name = "";
131
let j = i + 1;
132
133
- while (j < chars.length) {
134
- if (NAME_RE.test(chars[j])) {
135
- name += chars[j++];
136
- continue;
137
- }
138
-
139
- break;
+ while (NAME_RE.test(chars[j])) {
+ name += chars[j++];
140
}
141
142
if (!name) throw new TypeError(`Missing parameter name at ${i}`);
0 commit comments