00001 var isArray = require('./isArray'), 00002 isKey = require('./_isKey'), 00003 stringToPath = require('./_stringToPath'), 00004 toString = require('./toString'); 00005 00014 function castPath(value, object) { 00015 if (isArray(value)) { 00016 return value; 00017 } 00018 return isKey(value, object) ? [value] : stringToPath(toString(value)); 00019 } 00020 00021 module.exports = castPath;