fileUrl.js 336 B

12345678910
  1. // Helper function to compute the url for a file in history-v1 or filestore.
  2. // This will be obsolete when the migration to history-v1 is complete.
  3. export function fileUrl(projectId, id, hash) {
  4. if (hash) {
  5. return `/project/${projectId}/blob/${hash}?fallback=${id}`
  6. } else {
  7. return `/project/${projectId}/file/${id}`
  8. }
  9. }