Skip to content

Commit

Permalink
Enable flowtype for buildConsoleReplay.js
Browse files Browse the repository at this point in the history
we don't need additional `console.history.length === 0` check
```js
let line = []
line.join('\n') // results in ''
```
  • Loading branch information
AlexKVal committed Aug 22, 2016
1 parent fd97250 commit 467807c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions node_package/src/buildConsoleReplay.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 467807c

Please sign in to comment.