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`.
This commit is contained in:
Yash Ladha 2020-11-05 12:19:58 +05:30 committed by GitHub
parent d606b8076f
commit d8932ca187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);