mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
parent
d606b8076f
commit
d8932ca187
@ -14,8 +14,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const isNode = !!(
|
export const isNode = !!(typeof process !== 'undefined' && process.version);
|
||||||
typeof process !== 'undefined' &&
|
|
||||||
process.versions &&
|
|
||||||
process.versions.node
|
|
||||||
);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user