aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-02 17:55:42 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-02 17:55:42 -0700
commitef6d25a48fd6aa73341a30f061d246ee198a24b4 (patch)
treef5ed12240104335ca0459e2519e5c8727a95839a
parentc2a77cf7ec9de9eadf938046bdf78e58561c8a6d (diff)
downloadbun-ef6d25a48fd6aa73341a30f061d246ee198a24b4.tar.gz
bun-ef6d25a48fd6aa73341a30f061d246ee198a24b4.tar.zst
bun-ef6d25a48fd6aa73341a30f061d246ee198a24b4.zip
Fix
-rw-r--r--examples/macros/matchInFile.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/macros/matchInFile.tsx b/examples/macros/matchInFile.tsx
index e434d1dec..4793661d9 100644
--- a/examples/macros/matchInFile.tsx
+++ b/examples/macros/matchInFile.tsx
@@ -1,12 +1,12 @@
// macro code
-export function matchInFile(callExpression: BunAST.CallExpression) {
+export async function matchInFile(callExpression: BunAST.CallExpression) {
const [filePathNode, matcherNode] = callExpression.arguments;
let filePath: string;
filePath = filePathNode.get();
let matcher: RegExp;
matcher = matcherNode.get();
- const file: string = Bun.readFile(Bun.cwd + filePath);
+ const file: string = await Bun.file(Bun.cwd + filePath).text();
return (
<array>