mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Ensure _.flatten handles empty arrays.
This commit is contained in:
3
dist/lodash.underscore.js
vendored
3
dist/lodash.underscore.js
vendored
@@ -419,7 +419,8 @@
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
|
||||
if (value && typeof value == 'object' && value.length && (isArray(value) || isArguments(value))) {
|
||||
if (value && typeof value == 'object' && typeof value.length == 'number'
|
||||
&& (isArray(value) || isArguments(value))) {
|
||||
// recursively flatten arrays (susceptible to call stack limits)
|
||||
if (!isShallow) {
|
||||
value = baseFlatten(value, isShallow, isArgArrays);
|
||||
|
||||
Reference in New Issue
Block a user