From 467807cf2bd53331ba6a529d14df24f201115b25 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Mon, 22 Aug 2016 21:09:50 +0300 Subject: [PATCH] Enable flowtype for buildConsoleReplay.js we don't need additional `console.history.length === 0` check ```js let line = [] line.join('\n') // results in '' ``` --- node_package/src/buildConsoleReplay.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node_package/src/buildConsoleReplay.js b/node_package/src/buildConsoleReplay.js index 0aaad331b9..056a58a0a0 100644 --- a/node_package/src/buildConsoleReplay.js +++ b/node_package/src/buildConsoleReplay.js @@ -1,14 +1,15 @@ +// @flow + import RenderUtils from './RenderUtils'; import scriptSanitizedVal from './scriptSanitizedVal'; export function consoleReplay() { // console.history is a global polyfill used in server rendering. - const history = console.history; - if (!history || history.length === 0) { + if (!(console.history instanceof Array)) { return ''; } - const lines = history.map(msg => { + const lines = console.history.map(msg => { const stringifiedList = msg.arguments.map(arg => { let val; try {