From c22b8d02b74021b615cb98688dd833da258f1659 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Sat, 2 Nov 2024 15:15:25 -0600 Subject: [PATCH] style: automatic fixes for new ESLint rules Signed-off-by: Kevin Locke --- test/visit.js | 2 +- visit.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/visit.js b/test/visit.js index 5b9113b..ca93f61 100644 --- a/test/visit.js +++ b/test/visit.js @@ -109,7 +109,7 @@ describe('visit', () => { assert.fail(); } catch (err) { assert.strictEqual(err, errTest); - assert(!hasOwnProperty.call(err, 'transformPath')); + assert(!Object.hasOwn(err, 'transformPath')); assert.deepStrictEqual(transformPath, []); } }); diff --git a/visit.js b/visit.js index 87af410..adaa1c4 100644 --- a/visit.js +++ b/visit.js @@ -31,7 +31,7 @@ function visit(transformer, method, propName, ...args) { return method.apply(transformer, args); } catch (err) { handlingException = true; - if (err instanceof Error && !hasOwnProperty.call(err, 'transformPath')) { + if (err instanceof Error && !Object.hasOwn(err, 'transformPath')) { err.transformPath = [...transformer.transformPath]; err.message += ` (while transforming ${toJsonPointer(err.transformPath)})`;