Bump to v4.17.1.

This commit is contained in:
John-David Dalton
2016-11-14 21:01:42 -08:00
parent 9849321273
commit 5585b3ae22
21 changed files with 172 additions and 168 deletions

View File

@@ -1,15 +1,21 @@
var isArray = require('./isArray'),
stringToPath = require('./_stringToPath');
isKey = require('./_isKey'),
stringToPath = require('./_stringToPath'),
toString = require('./toString');
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;