From d8932ca18722cb97811577277e4d7e3add250d10 Mon Sep 17 00:00:00 2001 From: Yash Ladha <201551061@iiitvadodara.ac.in> Date: Thu, 5 Nov 2020 12:19:58 +0530 Subject: [PATCH] chore: shorter node checker function (#6584) `isNode` checks for the node version in which the process is running and it checks for the node key inside the versions. This is exactly the same as using `process.version` as they are set in the native code and `process.version` is just a shorthand for `process.versions.node`. --- src/environment.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/environment.ts b/src/environment.ts index 25c59864eb4..f7d869775bf 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -14,8 +14,4 @@ * limitations under the License. */ -export const isNode = !!( - typeof process !== 'undefined' && - process.versions && - process.versions.node -); +export const isNode = !!(typeof process !== 'undefined' && process.version);