Move internal modules to “internal” folder.

This commit is contained in:
John-David Dalton
2017-01-10 00:44:25 -08:00
parent 2b05673125
commit 26ea38dcf4
500 changed files with 726 additions and 726 deletions

20
.internal/castPath.js Normal file
View File

@@ -0,0 +1,20 @@
import isKey from './.internal/isKey.js';
import stringToPath from './.internal/stringToPath.js';
import toString from './toString.js';
/**
* 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, object) {
if (Array.isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
export default castPath;