From 353b07f4e4b7215f418e9b35f14cf4926a0f1d1f Mon Sep 17 00:00:00 2001 From: Mariah Hanson Date: Wed, 29 Nov 2017 11:47:17 -0500 Subject: [PATCH] Fixing order of typechecking and value reassignment --- src/tabs/getItemString.js | 3 ++- src/types.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tabs/getItemString.js b/src/tabs/getItemString.js index 04ebbbd..1117e83 100644 --- a/src/tabs/getItemString.js +++ b/src/tabs/getItemString.js @@ -5,12 +5,13 @@ import getType from '../utils/getType'; import type { StylingFunction } from 'react-base16-styling'; function getShortTypeString(val: any, diff?: boolean): string { - const type = getType(val); if (diff && Array.isArray(val)) { val = val[val.length === 2 ? 1 : 0]; } + const type = getType(val); + switch (type) { case 'Immutable List': case 'Immutable Stack': diff --git a/src/types.js b/src/types.js index abf25fd..d986b09 100644 --- a/src/types.js +++ b/src/types.js @@ -1,3 +1,5 @@ +// @noflow + export type Action = { timestamp: Date, error: ?string