MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / normalizePath

Function normalizePath

src/models/GitConfig.js:124–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124const normalizePath = path => {
125 const pathSegments = path.split('.')
126 const section = pathSegments.shift()
127 const name = pathSegments.pop()
128 const subsection = pathSegments.length ? pathSegments.join('.') : undefined
129
130 return {
131 section,
132 subsection,
133 name,
134 path: getPath(section, subsection, name),
135 sectionPath: getPath(section, subsection, null),
136 isSection: !!section,
137 }
138}
139
140const findLastIndex = (array, callback) => {
141 return array.reduce((lastIndex, item, index) => {

Callers 2

getMethod · 0.85
setMethod · 0.85

Calls 1

getPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…