Socket
Socket
Sign inDemoInstall

browser-or-node

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.1

10

lib/index.js

@@ -6,9 +6,17 @@ 'use strict';

});
/* global window */
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* global window self */
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
/* eslint-disable no-restricted-globals */
var isWebWorker = (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self.constructor && self.constructor.name === 'DedicatedWorkerGlobalScope';
/* eslint-enable no-restricted-globals */
var isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
exports.isBrowser = isBrowser;
exports.isWebWorker = isWebWorker;
exports.isNode = isNode;

5

package.json
{
"name": "browser-or-node",
"version": "1.1.0",
"version": "1.2.1",
"description": "Check where the code is running in the browser or node.js",

@@ -34,2 +34,5 @@ "main": "./lib/index.js",

"author": "Dineshkumar Pandiyan <flexdinesh@gmail.com>",
"contributors": [
"Daniel Wang <daniel.liberated@gmail.com> (https://github.com/dan1wang/)"
],
"license": "MIT",

@@ -36,0 +39,0 @@ "bugs": {

@@ -0,0 +0,0 @@ # Browser or Node.js

@@ -1,5 +0,12 @@

/* global window */
/* global window self */
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
/* eslint-disable no-restricted-globals */
const isWebWorker =
typeof self === 'object' &&
self.constructor &&
self.constructor.name === 'DedicatedWorkerGlobalScope';
/* eslint-enable no-restricted-globals */
const isNode =

@@ -12,3 +19,4 @@ typeof process !== 'undefined' &&

isBrowser,
isWebWorker,
isNode
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc