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

ts-invariant

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-invariant - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

2

lib/invariant.d.ts

@@ -12,4 +12,4 @@ /// <reference types="node" />

}
declare const processStub: NodeJS.Process;
declare let processStub: NodeJS.Process;
export { processStub as process };
export default invariant;

@@ -47,3 +47,22 @@ import { __extends } from 'tslib';

// import this process stub to avoid errors evaluating process.env.NODE_ENV.
var processStub = typeof process === "object" ? process : { env: {} };
// However, because most ESM-to-CJS compilers will rewrite the process import
// as tsInvariant.process, which prevents proper replacement by minifiers, we
// also attempt to define the stub globally when it is not already defined.
var processStub = { env: {} };
if (typeof process === "object") {
processStub = process;
}
else
try {
// Using Function to evaluate this assignment in global scope also escapes
// the strict mode of the current module, thereby allowing the assignment.
// Inspired by https://github.com/facebook/regenerator/pull/369.
Function("stub", "process = stub")(processStub);
}
catch (atLeastWeTried) {
// The assignment can fail if a Content Security Policy heavy-handedly
// forbids Function usage. In those environments, developers should take
// extra care to replace process.env.NODE_ENV in their production builds,
// or define an appropriate global.process polyfill.
}
var invariant$1 = invariant;

@@ -50,0 +69,0 @@

@@ -51,3 +51,22 @@ 'use strict';

// import this process stub to avoid errors evaluating process.env.NODE_ENV.
var processStub = typeof process === "object" ? process : { env: {} };
// However, because most ESM-to-CJS compilers will rewrite the process import
// as tsInvariant.process, which prevents proper replacement by minifiers, we
// also attempt to define the stub globally when it is not already defined.
exports.process = { env: {} };
if (typeof process === "object") {
exports.process = process;
}
else
try {
// Using Function to evaluate this assignment in global scope also escapes
// the strict mode of the current module, thereby allowing the assignment.
// Inspired by https://github.com/facebook/regenerator/pull/369.
Function("stub", "process = stub")(exports.process);
}
catch (atLeastWeTried) {
// The assignment can fail if a Content Security Policy heavy-handedly
// forbids Function usage. In those environments, developers should take
// extra care to replace process.env.NODE_ENV in their production builds,
// or define an appropriate global.process polyfill.
}
var invariant$1 = invariant;

@@ -58,2 +77,1 @@

exports.invariant = invariant;
exports.process = processStub;
{
"name": "ts-invariant",
"version": "0.3.3",
"version": "0.4.0",
"author": "Ben Newman <ben@apollographql.com>",

@@ -40,3 +40,3 @@ "description": "TypeScript implementation of invariant(condition, message)",

},
"gitHead": "d5765c576b70d6de0ab9539abba371c185e64f36"
"gitHead": "2da3ab3d9eada0f37a6ed4a53c1932d651fb4014"
}

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