MCPcopy Create free account
hub / github.com/Autodesk/react-base-table / getPathSegments

Function getPathSegments

src/utils.js:139–155  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

137}
138
139function getPathSegments(path) {
140 const pathArray = path.split('.');
141 const parts = [];
142
143 for (let i = 0; i < pathArray.length; i++) {
144 let p = pathArray[i];
145
146 while (p[p.length - 1] === '\\' && pathArray[i + 1] !== undefined) {
147 p = p.slice(0, -1) + '.';
148 p += pathArray[++i];
149 }
150
151 parts.push(p);
152 }
153
154 return parts;
155}
156
157// changed from https://github.com/sindresorhus/dot-prop/blob/master/index.js
158export function getValue(object, path, defaultValue) {

Callers 1

getValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected