MCPcopy Create free account
hub / github.com/decaporg/decap-cms / getFile

Function getFile

packages/decap-cms-backend-test/src/implementation.ts:61–68  ·  view source on GitHub ↗
(path: string, tree: RepoTree)

Source from the content-addressed store, hash-verified

59window.repoNotes = window.repoNotes || {};
60
61function getFile(path: string, tree: RepoTree) {
62 const segments = path.split('/');
63 let obj: RepoTree = tree;
64 while (obj && segments.length) {
65 obj = obj[segments.shift() as string] as RepoTree;
66 }
67 return (obj as unknown as RepoFile) || {};
68}
69
70function writeFile(path: string, content: string | AssetProxy, tree: RepoTree) {
71 const segments = path.split('/');

Callers 4

entriesByFilesMethod · 0.70
getEntryMethod · 0.70
getMediaFileMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected