Fix typeof-array-check

Using Lo-Dash' `isArray` function to check for `array` objects as `typeof []` gives just 'object'.