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

Function getFile

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

Source from the content-addressed store, hash-verified

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