New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

context

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

context - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

21

dist/cjs/context.development.js

@@ -24,7 +24,14 @@ 'use strict';

/**
* Throws a timed out error.
*/
function throwError(devMessage, productionMessage) {
throw new Error(devMessage );
function invariant(condition,
// eslint-disable-next-line @typescript-eslint/ban-types
message) {
if (condition) {
return;
}
// If message is a string object (rather than string literal)
// Throw the value directly as a string
// Alternatively, throw an error with the message
throw message instanceof String
? message.valueOf()
: new Error(message ? optionalFunctionValue(message) : message);
}

@@ -42,4 +49,4 @@

function useX(errorMessage) {
var _a;
return ((_a = storage.ctx) !== null && _a !== void 0 ? _a : throwError(defaultTo(errorMessage, 'Context was used after it was closed')));
invariant(storage.ctx, defaultTo(errorMessage, 'Context was used after it was closed'));
return storage.ctx;
}

@@ -46,0 +53,0 @@ function run(ctxRef, fn) {

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=Object.assign;function t(n){return"function"==typeof n}function r(n){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return t(n)?n.apply(void 0,r):n}function e(n,t){var e;return null!==(e=r(n))&&void 0!==e?e:t}exports.createContext=function(t){function u(e,u){var i,f,a=o();return e=n({},a||{},null!==(i=r(t,e,a))&&void 0!==i?i:e),i=c.ctx=Object.freeze(e),c.ancestry.unshift(i),u=u(i),c.ancestry.shift(),c.ctx=null!==(f=c.ancestry[0])&&void 0!==f?f:null,u}function o(){return c.ctx}var c={ancestry:[]};return{bind:function(n,t){return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return u(n,(function(){return t.apply(void 0,r)}))}},run:u,use:o,useX:function(n){var t;return null!==(t=c.ctx)&&void 0!==t?t:function(n,t){throw Error(e(t,n))}(e(n,"Context was used after it was closed"))}}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=Object.assign;function t(n){return"function"==typeof n}function r(n){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return t(n)?n.apply(void 0,r):n}exports.createContext=function(t){function e(e,c){var i,f,a=u();return e=n({},a||{},null!==(i=r(t,e,a))&&void 0!==i?i:e),i=o.ctx=Object.freeze(e),o.ancestry.unshift(i),c=c(i),o.ancestry.shift(),o.ctx=null!==(f=o.ancestry[0])&&void 0!==f?f:null,c}function u(){return o.ctx}var o={ancestry:[]};return{bind:function(n,t){return function(){for(var r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];return e(n,(function(){return t.apply(void 0,r)}))}},run:e,use:u,useX:function(n){return function(n,t){if(!n)throw t instanceof String?t.valueOf():Error(t?r(t):t)}(o.ctx,function(n,t){var e;return null!==(e=r(n))&&void 0!==e?e:t}(n,"Context was used after it was closed")),o.ctx}}};

@@ -20,7 +20,14 @@ var assign = Object.assign;

/**
* Throws a timed out error.
*/
function throwError(devMessage, productionMessage) {
throw new Error(devMessage );
function invariant(condition,
// eslint-disable-next-line @typescript-eslint/ban-types
message) {
if (condition) {
return;
}
// If message is a string object (rather than string literal)
// Throw the value directly as a string
// Alternatively, throw an error with the message
throw message instanceof String
? message.valueOf()
: new Error(message ? optionalFunctionValue(message) : message);
}

@@ -38,4 +45,4 @@

function useX(errorMessage) {
var _a;
return ((_a = storage.ctx) !== null && _a !== void 0 ? _a : throwError(defaultTo(errorMessage, 'Context was used after it was closed')));
invariant(storage.ctx, defaultTo(errorMessage, 'Context was used after it was closed'));
return storage.ctx;
}

@@ -42,0 +49,0 @@ function run(ctxRef, fn) {

@@ -1,1 +0,1 @@

var n=Object.assign;function t(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"function"==typeof n?n.apply(void 0,t):n}function r(n,r){var e;return null!==(e=t(n))&&void 0!==e?e:r}export function createContext(e){function u(r,u){var c,a,f=o();return r=n({},f||{},null!==(c=t(e,r,f))&&void 0!==c?c:r),c=i.ctx=Object.freeze(r),i.ancestry.unshift(c),u=u(c),i.ancestry.shift(),i.ctx=null!==(a=i.ancestry[0])&&void 0!==a?a:null,u}function o(){return i.ctx}var i={ancestry:[]};return{bind:function(n,t){return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return u(n,(function(){return t.apply(void 0,r)}))}},run:u,use:o,useX:function(n){var t;if(null===(t=i.ctx)||void 0===t)throw n=r(n,"Context was used after it was closed"),Error(r(void 0,n));return t}}}
var n=Object.assign;function t(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"function"==typeof n?n.apply(void 0,t):n}export function createContext(r){function e(e,c){var i,a,f=u();return e=n({},f||{},null!==(i=t(r,e,f))&&void 0!==i?i:e),i=o.ctx=Object.freeze(e),o.ancestry.unshift(i),c=c(i),o.ancestry.shift(),o.ctx=null!==(a=o.ancestry[0])&&void 0!==a?a:null,c}function u(){return o.ctx}var o={ancestry:[]};return{bind:function(n,t){return function(){for(var r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];return e(n,(function(){return t.apply(void 0,r)}))}},run:e,use:u,useX:function(n){var r,e=o.ctx;if(n=null!==(r=t(n))&&void 0!==r?r:"Context was used after it was closed",!e)throw n instanceof String?n.valueOf():Error(n?t(n):n);return o.ctx}}}

@@ -26,7 +26,14 @@ (function (global, factory) {

/**
* Throws a timed out error.
*/
function throwError(devMessage, productionMessage) {
throw new Error(devMessage );
function invariant(condition,
// eslint-disable-next-line @typescript-eslint/ban-types
message) {
if (condition) {
return;
}
// If message is a string object (rather than string literal)
// Throw the value directly as a string
// Alternatively, throw an error with the message
throw message instanceof String
? message.valueOf()
: new Error(message ? optionalFunctionValue(message) : message);
}

@@ -44,4 +51,4 @@

function useX(errorMessage) {
var _a;
return ((_a = storage.ctx) !== null && _a !== void 0 ? _a : throwError(defaultTo(errorMessage, 'Context was used after it was closed')));
invariant(storage.ctx, defaultTo(errorMessage, 'Context was used after it was closed'));
return storage.ctx;
}

@@ -48,0 +55,0 @@ function run(ctxRef, fn) {

@@ -1,1 +0,1 @@

"use strict";!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).context={})}(this,(function(n){function t(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return"function"==typeof n?n.apply(void 0,t):n}function e(n,e){var r;return null!==(r=t(n))&&void 0!==r?r:e}var r=Object.assign;n.createContext=function(n){function o(e,o){var f,c,s=u();return e=r({},s||{},null!==(f=t(n,e,s))&&void 0!==f?f:e),f=i.ctx=Object.freeze(e),i.ancestry.unshift(f),o=o(f),i.ancestry.shift(),i.ctx=null!==(c=i.ancestry[0])&&void 0!==c?c:null,o}function u(){return i.ctx}var i={ancestry:[]};return{bind:function(n,t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return o(n,(function(){return t.apply(void 0,e)}))}},run:o,use:u,useX:function(n){var t;if(null===(t=i.ctx)||void 0===t)throw n=e(n,"Context was used after it was closed"),Error(e(void 0,n));return t}}},Object.defineProperty(n,"__esModule",{value:!0})}));
"use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).context={})}(this,(function(t){function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return"function"==typeof t?t.apply(void 0,e):t}var n=Object.assign;t.createContext=function(t){function r(r,i){var f,c,s=o();return r=n({},s||{},null!==(f=e(t,r,s))&&void 0!==f?f:r),f=u.ctx=Object.freeze(r),u.ancestry.unshift(f),i=i(f),u.ancestry.shift(),u.ctx=null!==(c=u.ancestry[0])&&void 0!==c?c:null,i}function o(){return u.ctx}var u={ancestry:[]};return{bind:function(t,e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return r(t,(function(){return e.apply(void 0,n)}))}},run:r,use:o,useX:function(t){var n,r=u.ctx;if(t=null!==(n=e(t))&&void 0!==n?n:"Context was used after it was closed",!r)throw t instanceof String?t.valueOf():Error(t?e(t):t);return u.ctx}}},Object.defineProperty(t,"__esModule",{value:!0})}));
{
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",

@@ -45,3 +45,5 @@ "main": "./dist/cjs/context.js",

"url": "https://github.com/ealush/vest.git/issues"
}
},
"unpkg": "./dist/umd/context.production.js",
"jsdelivr": "./dist/umd/context.production.js"
}
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