@@ -411,9 +411,9 @@ import icon from "./icon.png" with { type: "file" };
411411import { file } from " bun" ;
412412
413413// Get file contents as different types
414- const bytes = await file (icon ).arrayBuffer (); // ArrayBuffer
415- const text = await file (icon ).text (); // string (for text files)
416- const blob = file (icon ); // Blob
414+ const bytes = await file (icon ).arrayBuffer (); // ArrayBuffer
415+ const text = await file (icon ).text (); // string (for text files)
416+ const blob = file (icon ); // Blob
417417
418418// Stream the file in a response
419419export default {
@@ -458,7 +458,9 @@ import { file } from "bun";
458458const defaultConfig = await file (configPath ).json ();
459459
460460// Merge with user config if it exists
461- const userConfig = await file (" ./user-config.json" ).json ().catch (() => ({}));
461+ const userConfig = await file (" ./user-config.json" )
462+ .json ()
463+ .catch (() => ({}));
462464const config = { ... defaultConfig , ... userConfig };
463465```
464466
@@ -494,9 +496,7 @@ import { file } from "bun";
494496
495497async function sendWelcomeEmail(user : { name: string ; email: string }) {
496498 const template = await file (templatePath ).text ();
497- const html = template
498- .replace (" {{name}}" , user .name )
499- .replace (" {{email}}" , user .email );
499+ const html = template .replace (" {{name}}" , user .name ).replace (" {{email}}" , user .email );
500500
501501 // Send email with the rendered template...
502502}
@@ -588,7 +588,7 @@ for (const blob of embeddedFiles) {
588588Each item in ` Bun.embeddedFiles ` is a ` Blob ` with a ` name ` property:
589589
590590``` ts
591- embeddedFiles : ReadonlyArray < Blob >
591+ embeddedFiles : ReadonlyArray < Blob > ;
592592```
593593
594594This is useful for dynamically serving all embedded assets using ` static ` routes:
0 commit comments