MCPcopy Index your code
hub / github.com/adaltas/node-csv / stringToPath

Function stringToPath

packages/csv-stringify/lib/utils/get.js:59–74  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

57};
58
59const stringToPath = function (string) {
60 const result = [];
61 if (string.charCodeAt(0) === charCodeOfDot) {
62 result.push("");
63 }
64 string.replace(rePropName, function (match, expression, quote, subString) {
65 let key = match;
66 if (quote) {
67 key = subString.replace(reEscapeChar, "$1");
68 } else if (expression) {
69 key = expression.trim();
70 }
71 result.push(key);
72 });
73 return result;
74};
75
76const castPath = function (value, object) {
77 if (Array.isArray(value)) {

Callers 1

castPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected