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

Method toString

src/models/GitConfig.js:276–295  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274 }
275
276 toString() {
277 return this.parsedConfig
278 .map(({ line, section, subsection, name, value, modified = false }) => {
279 if (!modified) {
280 return line
281 }
282 if (name != null && value != null) {
283 if (typeof value === 'string' && /[#;]/.test(value)) {
284 // A `#` or `;` symbol denotes a comment, so we have to wrap it in double quotes
285 return `\t${name} = "${value}"`
286 }
287 return `\t${name} = ${value}`
288 }
289 if (subsection != null) {
290 return `[${section} "${subsection}"]`
291 }
292 return `[${section}]`
293 })
294 .join('\n')
295 }
296}

Callers 15

_checkoutFunction · 0.45
updateWorkingDirFunction · 0.45
_fetchFunction · 0.45
_packObjectsFunction · 0.45
writeObjectFunction · 0.45
readObjectPackedFunction · 0.45
constructorMethod · 0.45
saveMethod · 0.45
stringifyBodyFunction · 0.45
deleteRefsMethod · 0.45
readObjectFunction · 0.45
parseUploadPackResponseFunction · 0.45

Calls

no outgoing calls

Tested by 6

toWalkerResultFunction · 0.36
stashChangesFunction · 0.36
stashChangesFunction · 0.36
toWalkerResultFunction · 0.36
jsdocConfigFunction · 0.36
processEntryFunction · 0.36