MCPcopy Create free account
hub / github.com/cloudflare/agents / toFileInfo

Function toFileInfo

packages/shell/src/filesystem.ts:1603–1624  ·  view source on GitHub ↗
(r: {
  path: string;
  name: string;
  type: string;
  mime_type: string;
  size: number;
  created_at: number;
  modified_at: number;
  target?: string | null;
})

Source from the content-addressed store, hash-verified

1601}
1602
1603function toFileInfo(r: {
1604 path: string;
1605 name: string;
1606 type: string;
1607 mime_type: string;
1608 size: number;
1609 created_at: number;
1610 modified_at: number;
1611 target?: string | null;
1612}): FileInfo {
1613 const info: FileInfo = {
1614 path: r.path,
1615 name: r.name,
1616 type: r.type as EntryType,
1617 mimeType: r.mime_type,
1618 size: r.size,
1619 createdAt: r.created_at * 1000,
1620 updatedAt: r.modified_at * 1000
1621 };
1622 if (r.target) info.target = r.target;
1623 return info;
1624}
1625
1626// ── Glob helpers ─────────────────────────────────────────────────────
1627

Callers 2

lstatMethod · 0.85
statMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected