Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bv-ui-core

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bv-ui-core - npm Package Compare versions

Comparing version 2.8.0 to 2.8.1

35

lib/global/index.js

@@ -9,9 +9,34 @@ /**

var getGlobal = function () {
if (typeof globalThis !== 'undefined') { return globalThis; }
if (typeof window !== 'undefined') { return window; }
if (typeof self !== 'undefined') { return self; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
var globalObj = (function () {
if (typeof globalThis !== 'undefined') { return globalThis; }
if (typeof window !== 'undefined') { return window; }
if (typeof self !== 'undefined') { return self; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
})()
/*
The below code was added in case there is pollution in global namespace
windows object during transpilation with __esModule being set. Below code would support
global import in all bundle use cases
*/
if (globalObj && globalObj.__esModule) {
const override = {
get: function (target, prop, receiver) {
if (prop === 'default') {
return target
}
return Reflect.get(receiver, prop, target)
},
set: function (target, prop, value) {
Reflect.set(target, prop, value)
},
};
const proxyGlobal = new Proxy(globalObj, override)
return proxyGlobal
}
return globalObj
};
module.exports = getGlobal();

2

package.json
{
"name": "bv-ui-core",
"version": "2.8.0",
"version": "2.8.1",
"license": "Apache 2.0",

@@ -5,0 +5,0 @@ "description": "Bazaarvoice UI-related JavaScript",

@@ -18,2 +18,11 @@ /**

it('should export window with default pointing to windows if __esModule is set', function () {
// If we have access to the window object, compare against it.
if (typeof window !== 'undefined') {
window.__esModule = true
var global = require('../../../lib/global')
expect(global).to.eql(window);
}
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc