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

Function parseCapabilitiesV2

src/wire/parseCapabilitiesV2.js:6–26  ·  view source on GitHub ↗
(read)

Source from the content-addressed store, hash-verified

4 * @param {function} read
5 */
6export async function parseCapabilitiesV2(read) {
7 /** @type {Object<string, string | true>} */
8 const capabilities2 = {}
9
10 let line
11 while (true) {
12 line = await read()
13 if (line === true) break
14 if (line === null) continue
15 line = line.toString('utf8').replace(/\n$/, '')
16 const i = line.indexOf('=')
17 if (i > -1) {
18 const key = line.slice(0, i)
19 const value = line.slice(i + 1)
20 capabilities2[key] = value
21 } else {
22 capabilities2[line] = true
23 }
24 }
25 return { protocolVersion: 2, capabilities2 }
26}

Callers 1

parseRefsAdResponseFunction · 0.90

Calls 2

sliceMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…