MCPcopy Create free account
hub / github.com/RubyLouvre/anu / castPath

Function castPath

test/babel.js:28154–28159  ·  view source on GitHub ↗

* 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.

(value, object)

Source from the content-addressed store, hash-verified

28152 * @returns {Array} Returns the cast property path array.
28153 */
28154 function castPath(value, object) {
28155 if (isArray(value)) {
28156 return value;
28157 }
28158 return isKey(value, object) ? [value] : stringToPath(toString(value));
28159 }
28160
28161 module.exports = castPath;
28162

Callers 2

baseGetFunction · 0.85
hasPathFunction · 0.85

Calls 3

isArrayFunction · 0.85
isKeyFunction · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected