MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / toPath

Function toPath

lib/web/jshint.js:5975–5984  ·  view source on GitHub ↗

* Converts `value` to property path array if it is not one. * * @private * @param {*} value The value to process. * @returns {Array} Returns the property path array.

(value)

Source from the content-addressed store, hash-verified

5973 * @returns {Array} Returns the property path array.
5974 */
5975 function toPath(value) {
5976 if (isArray(value)) {
5977 return value;
5978 }
5979 var result = [];
5980 baseToString(value).replace(rePropName, function(match, number, quote, string) {
5981 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
5982 });
5983 return result;
5984 }
5985
5986 /**
5987 * Creates a clone of `wrapper`.

Callers 8

baseMatchesPropertyFunction · 0.85
basePropertyDeepFunction · 0.85
invokePathFunction · 0.85
getFunction · 0.85
hasFunction · 0.85
resultFunction · 0.85
setFunction · 0.85
propertyOfFunction · 0.85

Calls 4

baseToStringFunction · 0.85
replaceMethod · 0.80
isArrayFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected