(x: FilesFile, parentPath: string)
| 221 | }; |
| 222 | |
| 223 | const 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 |
no test coverage detected