From 9f9069d3130dc336a86271ca4e3c36e9b87cce90 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 11 Oct 2024 00:50:19 +0200 Subject: [PATCH] fs: fix linter issue PR-URL: https://github.com/nodejs/node/pull/55353 Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Chemi Atlow Reviewed-By: Yagiz Nizipli --- lib/internal/fs/utils.js | 2 +- test/sequential/test-fs-path-dir.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 703a79371d867d..2d85ed2196529d 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -723,7 +723,7 @@ const validatePath = hideStackFrames((path, propName = 'path', options) => { const pathIsString = typeof path === 'string'; const pathIsUint8Array = isUint8Array(path); - if (options && options.expectFile) { + if (options?.expectFile) { const lastCharacter = path[path.length - 1]; if ( lastCharacter === '/' || lastCharacter === 47 || diff --git a/test/sequential/test-fs-path-dir.js b/test/sequential/test-fs-path-dir.js index 8ba5e59fdc290e..fd44c19ff333e4 100644 --- a/test/sequential/test-fs-path-dir.js +++ b/test/sequential/test-fs-path-dir.js @@ -77,7 +77,7 @@ function checkPromiseFn(promiseFn, p, args, fail) { console.log(failMsg, err); throw err; }); - if (r && r.close) r.close(); + r?.close?.(); } else { assert.rejects( promiseFn(p, ...args), {