Function
typeOf
(typeflag: string, path: string)
Source from the content-addressed store, hash-verified
| 608 | } |
| 609 | |
| 610 | const typeOf = (typeflag: string, path: string): EntryType => { |
| 611 | // Legacy archives mark directories with a trailing slash only |
| 612 | if (typeflag === "\0") return path.endsWith("/") ? "Directory" : "File" |
| 613 | return types[typeflag] ?? "Other" |
| 614 | } |
| 615 | |
| 616 | const typeflagOf = (header: Header): string => header.type === "Other" ? header.typeflag : typeflags[header.type] |
| 617 | |
Tested by
no test coverage detected