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

Function mkfile

src/utils/flatFileListToDirectoryStructure.js:36–51  ·  view source on GitHub ↗
(name, metadata)

Source from the content-addressed store, hash-verified

34 }
35
36 const mkfile = function (name, metadata) {
37 if (!inodes.has(name)) {
38 const file = {
39 type: 'blob',
40 fullpath: name,
41 basename: basename(name),
42 metadata,
43 // This recursively generates any missing parent folders.
44 parent: mkdir(dirname(name)),
45 children: [],
46 }
47 if (file.parent) file.parent.children.push(file)
48 inodes.set(name, file)
49 }
50 return inodes.get(name)
51 }
52
53 mkdir('.')
54 for (const file of files) {

Callers 1

Calls 6

basenameFunction · 0.90
dirnameFunction · 0.90
mkdirFunction · 0.85
hasMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…