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

Method streamReader

src/models/GitPktLine.js:76–93  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

74 }
75
76 static streamReader(stream) {
77 const reader = new StreamReader(stream)
78 return async function read() {
79 try {
80 let length = await reader.read(4)
81 if (length == null) return true
82 length = parseInt(length.toString('utf8'), 16)
83 if (length === 0) return null
84 if (length === 1) return null // delim packets
85 const buffer = await reader.read(length - 4)
86 if (buffer == null) return true
87 return buffer
88 } catch (err) {
89 stream.error = err
90 return true
91 }
92 }
93 }
94}

Callers 7

parseUploadPackRequestFunction · 0.80
parseRefsAdResponseFunction · 0.80
parseListRefsResponseFunction · 0.80
parseReceivePackResponseFunction · 0.80
demuxMethod · 0.80
test-GitPktLine.jsFile · 0.80

Calls 2

readMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected