Skip to content

basalt / drives-dropbox/src / toDriveItem

Function: toDriveItem() ​

> toDriveItem(entry): DriveItem

Defined in: drives-dropbox/src/metadata.ts:47

Maps one entry.

Three decisions worth stating, because each is a place a vendor difference could have been flattened:

  • version is rev, not a timestamp. Dropbox's rev changes when, and only when, the content changes; server_modified also moves on a move or a re-share. The dedup ledger prefers version, so a rename costs nothing.
  • checksum is labelled dropboxContentHash, not sha256. It is a block-tree digest (see content-hash.ts) and is not comparable with another provider's SHA-256 of the same bytes. Labelling it honestly is what stops an app from concluding two files differ because two vendors hash differently.
  • contentType is absent. Dropbox reports no media type at all, which is the contract's best case rather than its worst: contentType is documented as untrusted, and @basaltkit/files sniffs the bytes regardless.

Parameters ​

entry ​

DropboxEntry

Returns ​

DriveItem

Released under the MIT License.