path-to-regexp 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +1 -1
- package/Readme.md +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/History.md
CHANGED
package/Readme.md
CHANGED
@@ -192,7 +192,7 @@ toPathRegexp({ id: 'abc' }) //=> Throws `TypeError`.
|
|
192
192
|
|
193
193
|
Path-To-RegExp exposes the two functions used internally that accept an array of tokens.
|
194
194
|
|
195
|
-
* `pathToRegexp.tokensToRegExp(tokens, options)` Transform an array of tokens into a matching regular expression.
|
195
|
+
* `pathToRegexp.tokensToRegExp(tokens, keys?, options?)` Transform an array of tokens into a matching regular expression.
|
196
196
|
* `pathToRegexp.tokensToFunction(tokens)` Transform an array of tokens into a path generator function.
|
197
197
|
|
198
198
|
#### Token Information
|
package/index.js
CHANGED
@@ -305,7 +305,7 @@ function tokensToRegExp (tokens, keys, options) {
|
|
305
305
|
var delimiters = options.delimiters || DEFAULT_DELIMITERS
|
306
306
|
var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|')
|
307
307
|
var route = ''
|
308
|
-
var isEndDelimited =
|
308
|
+
var isEndDelimited = tokens.length === 0
|
309
309
|
|
310
310
|
// Iterate over the tokens and create our regexp string.
|
311
311
|
for (var i = 0; i < tokens.length; i++) {
|