00001 var arrayMap = require('./_arrayMap'), 00002 copyArray = require('./_copyArray'), 00003 isArray = require('./isArray'), 00004 isSymbol = require('./isSymbol'), 00005 stringToPath = require('./_stringToPath'), 00006 toKey = require('./_toKey'), 00007 toString = require('./toString'); 00008 00026 function toPath(value) { 00027 if (isArray(value)) { 00028 return arrayMap(value, toKey); 00029 } 00030 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 00031 } 00032 00033 module.exports = toPath;