From 347d2b3a92e2913a0f431bc99479d45403a52f46 Mon Sep 17 00:00:00 2001 From: jakecastelli <959672929@qq.com> Date: Sat, 4 Mar 2023 22:37:58 +1030 Subject: [PATCH] fix: add missing optional chaining operator --- doc/api/fs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index c794da1cac8576..bc3e29c6aadb03 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -7638,7 +7638,7 @@ try { fd = await open('/open/some/file.txt', 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ``` @@ -7652,7 +7652,7 @@ try { fd = await open('file.txt', 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ``` @@ -7767,7 +7767,7 @@ try { fd = await open(Buffer.from('/open/some/file.txt'), 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ```