From 241a772d553b28658f9b3f4d9755e60add67f866 Mon Sep 17 00:00:00 2001
From: "Anantachai Saothong (Manta)" <anantachai.s@taskworld.com>
Date: Thu, 28 Dec 2023 23:44:54 +0700
Subject: [PATCH] Code review

---
 dist/cache-save/index.js | 2 +-
 dist/setup/index.js      | 2 +-
 src/util.ts              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js
index 052bb13b..35d54949 100644
--- a/dist/cache-save/index.js
+++ b/dist/cache-save/index.js
@@ -83348,7 +83348,7 @@ function getNodeVersionFromFile(versionFilePath) {
     try {
         const manifest = JSON.parse(contents);
         // Presume package.json file.
-        if (typeof manifest === 'object' && manifest !== null) {
+        if (typeof manifest === 'object' && !!manifest) {
             // Support Volta.
             // See https://docs.volta.sh/guide/understanding#managing-your-project
             if ((_a = manifest.volta) === null || _a === void 0 ? void 0 : _a.node) {
diff --git a/dist/setup/index.js b/dist/setup/index.js
index 849917da..c0eade6d 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -93795,7 +93795,7 @@ function getNodeVersionFromFile(versionFilePath) {
     try {
         const manifest = JSON.parse(contents);
         // Presume package.json file.
-        if (typeof manifest === 'object' && manifest !== null) {
+        if (typeof manifest === 'object' && !!manifest) {
             // Support Volta.
             // See https://docs.volta.sh/guide/understanding#managing-your-project
             if ((_a = manifest.volta) === null || _a === void 0 ? void 0 : _a.node) {
diff --git a/src/util.ts b/src/util.ts
index c02524e3..cc6ac310 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -18,7 +18,7 @@ export function getNodeVersionFromFile(versionFilePath: string): string | null {
     const manifest = JSON.parse(contents);
 
     // Presume package.json file.
-    if (typeof manifest === 'object' && manifest !== null) {
+    if (typeof manifest === 'object' && !!manifest) {
       // Support Volta.
       // See https://docs.volta.sh/guide/understanding#managing-your-project
       if (manifest.volta?.node) {