Use Array.isArray.

This commit is contained in:
John-David Dalton
2017-01-09 18:44:38 -08:00
parent 395a81058b
commit 68190b8546
31 changed files with 34 additions and 64 deletions

View File

@@ -1,6 +1,5 @@
import arrayMap from './_arrayMap.js';
import copyArray from './_copyArray.js';
import isArray from './isArray.js';
import isSymbol from './isSymbol.js';
import stringToPath from './_stringToPath.js';
import toKey from './_toKey.js';
@@ -23,7 +22,7 @@ import toString from './toString.js';
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
if (Array.isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));