ts-invariant
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export declare class InvariantError extends Error { | ||
@@ -11,9 +10,9 @@ framesToPop: number; | ||
export declare namespace invariant { | ||
const log: (message?: any, ...optionalParams: any[]) => void; | ||
const warn: (message?: any, ...optionalParams: any[]) => void; | ||
const error: (message?: any, ...optionalParams: any[]) => void; | ||
const log: any; | ||
const warn: any; | ||
const error: any; | ||
} | ||
export declare function setVerbosity(level: VerbosityLevel): VerbosityLevel; | ||
declare const processStub: NodeJS.Process; | ||
declare const processStub: any; | ||
export { processStub as process }; | ||
export default invariant; |
import { __extends } from 'tslib'; | ||
import globalThis from '@ungap/global-this'; | ||
var global = globalThis; | ||
var console = global.console; | ||
var genericMessage = "Invariant Violation"; | ||
@@ -47,4 +49,9 @@ var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { | ||
} | ||
var processStub = globalThis.process || { env: {} }; | ||
if (!globalThis.process) | ||
// Code that uses ts-invariant with rollup-plugin-invariant may want to | ||
// import this process stub to avoid errors evaluating process.env.NODE_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 = global.process || { env: {} }; | ||
if (!global.process) | ||
try { | ||
@@ -51,0 +58,0 @@ Object.defineProperty(globalThis, "process", { |
@@ -12,2 +12,4 @@ 'use strict'; | ||
var global = globalThis__default['default']; | ||
var console = global.console; | ||
var genericMessage = "Invariant Violation"; | ||
@@ -56,4 +58,9 @@ var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { | ||
} | ||
var processStub = globalThis__default['default'].process || { env: {} }; | ||
if (!globalThis__default['default'].process) | ||
// Code that uses ts-invariant with rollup-plugin-invariant may want to | ||
// import this process stub to avoid errors evaluating process.env.NODE_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 = global.process || { env: {} }; | ||
if (!global.process) | ||
try { | ||
@@ -60,0 +67,0 @@ Object.defineProperty(globalThis__default['default'], "process", { |
{ | ||
"name": "ts-invariant", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"author": "Ben Newman <ben@apollographql.com>", | ||
@@ -28,3 +28,6 @@ "description": "TypeScript implementation of invariant(condition, message)", | ||
"prepublish": "npm run build", | ||
"test": "npm run build && npm run mocha" | ||
"pretest": "npm run build", | ||
"test": "npm run test:mocha && npm run test:no-node", | ||
"test:mocha": "npm run mocha", | ||
"test:no-node": "! grep -i node lib/invariant.d.ts" | ||
}, | ||
@@ -41,3 +44,3 @@ "dependencies": { | ||
"rollup": "^2.32.1", | ||
"rollup-plugin-typescript2": "^0.28.0" | ||
"rollup-plugin-typescript2": "^0.30.0" | ||
}, | ||
@@ -47,3 +50,3 @@ "engines": { | ||
}, | ||
"gitHead": "cf6fea0edc1da9db6478824231860a987ab44e55" | ||
"gitHead": "7915b3beff583b3e73b3e70d6c95ec2a82fb6638" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19631
207