Skip to content

gitflarePublicPartly agent-ready50

cf-r2-drop

Drag-and-drop file sharing on Cloudflare R2: multipart uploads, expiring share links, previews, download counts, lifecycle expiry.

Serve the share page from the extensionless asset path0e4544f
TypeScript8 lines419 B
export interface ObjLike { key: string; customMetadata?: Record<string, string> }/** Keys whose customMetadata.expiresAt is a number in the past. */export function expiredKeys(objects: ObjLike[], now = Date.now()): string[] {  return objects    .filter((o) => { const t = Number(o.customMetadata?.expiresAt); return Number.isFinite(t) && o.customMetadata?.expiresAt !== "" && t <= now; })    .map((o) => o.key);}