From fccb408a8ca8e4b57c9d7ef262832ac74fabb7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20T=C3=B6rnqvist?= Date: Mon, 11 Sep 2017 23:36:03 +0200 Subject: [PATCH] Fix toString remove last letter in href (#559) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index eb385f5..b49b385 100644 --- a/index.js +++ b/index.js @@ -187,7 +187,7 @@ Choo.prototype.toString = function (location, state) { assert.equal(typeof location, 'string', 'choo.toString: location should be type string') assert.equal(typeof this.state, 'object', 'choo.toString: state should be type object') - this.state.href = location.replace(/\?*.$/, '') + this.state.href = location.replace(/\?.+$/, '') this.state.query = nanoquery(location) var html = this.router(location) assert.ok(html, 'choo.toString: no valid value returned for the route ' + location)