MCPcopy Create free account
hub / github.com/codingmonk-yt/chat-app-latest / getFileData

Function getFileData

src/utils/getFileData.js:3–21  ·  view source on GitHub ↗
(file, index)

Source from the content-addressed store, hash-verified

1// ----------------------------------------------------------------------
2
3export default function getFileData(file, index) {
4 if (typeof file === 'string') {
5 return {
6 key: index ? `${file}-${index}` : file,
7 preview: file,
8 };
9 }
10
11 return {
12 key: index ? `${file.name}-${index}` : file.name,
13 name: file.name,
14 size: file.size,
15 path: file.path,
16 type: file.type,
17 preview: file.preview,
18 lastModified: file.lastModified,
19 lastModifiedDate: file.lastModifiedDate,
20 };
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected