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

effects-as-data

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effects-as-data - npm Package Compare versions

Comparing version 3.0.16 to 3.0.17

4

es5/interpreters.js
"use strict";
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; };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

@@ -61,3 +59,3 @@

// istanbul ignore next
var g = (typeof window === "undefined" ? "undefined" : _typeof(window)) === undefined ? global : window;
var g = typeof window === "undefined" ? global : window;
return g[name];

@@ -64,0 +62,0 @@ }

@@ -180,6 +180,15 @@ "use strict";

test("globalVariable() should use window if available", function () {
window.foo = "bar";
var value = globalVariable({ name: "foo" });
assert.equal(value, "bar");
global.window = {
foo: "bar window"
};
var value = globalVariable(coreCmds.globalVariable("foo"));
global.window = undefined;
assert.equal(value, "bar window");
});
test("globalVariable() should global if window is not available ", function () {
global.foo = "bar global";
var value = globalVariable(coreCmds.globalVariable("foo"));
assert.equal(value, "bar global");
});
//# sourceMappingURL=interpreters.spec.js.map
{
"name": "effects-as-data",
"version": "3.0.16",
"version": "3.0.17",
"description":

@@ -35,2 +35,3 @@ "A micro abstraction layer for Javascript that makes writing, testing, and monitoring side-effects easy.",

"jest": {
"testEnvironment": "node",
"testPathIgnorePatterns": [

@@ -37,0 +38,0 @@ "<rootDir>/test.js",

@@ -39,3 +39,3 @@ const { delay } = require("./util");

// istanbul ignore next
const g = typeof window === undefined ? global : window;
const g = typeof window === "undefined" ? global : window;
return g[name];

@@ -42,0 +42,0 @@ }

@@ -112,5 +112,14 @@ const assert = require("assert");

test("globalVariable() should use window if available", () => {
window.foo = "bar";
const value = globalVariable({ name: "foo" });
assert.equal(value, "bar");
global.window = {
foo: "bar window"
};
const value = globalVariable(coreCmds.globalVariable("foo"));
global.window = undefined;
assert.equal(value, "bar window");
});
test("globalVariable() should global if window is not available ", () => {
global.foo = "bar global";
const value = globalVariable(coreCmds.globalVariable("foo"));
assert.equal(value, "bar global");
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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