MCPcopy
hub / github.com/remotely-save/remotely-save / fromFileToEntity

Function fromFileToEntity

pro/src/fsKoofr.ts:223–238  ·  view source on GitHub ↗
(x: FilesFile, parentPath: string)

Source from the content-addressed store, hash-verified

221};
222
223const fromFileToEntity = (x: FilesFile, parentPath: string): Entity => {
224 const key = getNormPathFromBasedir(`${parentPath}/${x.name}`, x.type as any);
225 if (x.type === "dir" || x.type === "file") {
226 return {
227 key: key,
228 keyRaw: key,
229 mtimeCli: x.modified,
230 mtimeSvr: x.modified,
231 size: x.size,
232 sizeRaw: x.size,
233 hash: x.hash,
234 } as Entity;
235 } else {
236 throw Error(`cannot understand ${JSON.stringify(x)}`);
237 }
238};
239
240/**
241 * https://app.koofr.net/developers

Callers 3

walkPartialMethod · 0.85
statMethod · 0.85
writeFileMethod · 0.85

Calls 1

getNormPathFromBasedirFunction · 0.85

Tested by

no test coverage detected