Skip to content

Commit

Permalink
minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 6, 2024
1 parent de66184 commit ba657b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/stdlib/fileAttachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const files = new Map();

export function registerFile(name, file) {
const url = new URL(name, location).href;
if (file == null) return void files.delete(url);
files.set(url, {url: new URL(file.path, location).href, mimeType: file.mimeType});
if (file == null) files.delete(url);
else files.set(url, {url: new URL(file.path, location).href, mimeType: file.mimeType});
}

export function FileAttachment(name, base = location.href) {
Expand Down

0 comments on commit ba657b1

Please sign in to comment.