From 52ec4f3ad324129c3d677df6005bacb0fbfc3191 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Wed, 14 Mar 2018 12:21:05 +0100 Subject: [PATCH] assert for arrays on .toString() (#642) --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 7b1931f..811dba3 100644 --- a/index.js +++ b/index.js @@ -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() }