assert for arrays on .toString() (#642)

This commit is contained in:
Yoshua Wuyts
2018-03-14 12:21:05 +01:00
committed by GitHub
parent 3e95bbdf3c
commit 52ec4f3ad3
+1
View File
@@ -208,6 +208,7 @@ Choo.prototype.toString = function (location, state) {
this._matchRoute(location)
var html = this._prerender(this.state)
assert.ok(html, 'choo.toString: no valid value returned for the route ' + location)
assert(!Array.isArray(html), 'choo.toString: return value was an array for the route ' + location)
return typeof html.outerHTML === 'string' ? html.outerHTML : html.toString()
}