ts-invariant
Advanced tools
Comparing version 0.7.5 to 0.8.0
@@ -10,12 +10,16 @@ export declare class InvariantError extends Error { | ||
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: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
const warn: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
const error: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
} | ||
export declare function setVerbosity(level: VerbosityLevel): VerbosityLevel; | ||
export declare const processStub: { | ||
env: Record<string, any>; | ||
[key: string]: any; | ||
}; | ||
export { processStub as process }; | ||
export default invariant; |
@@ -46,14 +46,6 @@ import { __extends } from 'tslib'; | ||
} | ||
// 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 export processStub, so you can import { invariant, processStub } from | ||
// "ts-invariant" and assign processStub to a local variable named process. | ||
var processStub = (typeof process === "object" && | ||
typeof process.env === "object") ? process : { env: {} }; | ||
var invariant$1 = invariant; | ||
export default invariant$1; | ||
export { InvariantError, invariant, processStub as process, processStub, setVerbosity }; | ||
export { InvariantError, invariant, setVerbosity }; | ||
//# sourceMappingURL=invariant.esm.js.map |
@@ -50,10 +50,2 @@ 'use strict'; | ||
} | ||
// 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 export processStub, so you can import { invariant, processStub } from | ||
// "ts-invariant" and assign processStub to a local variable named process. | ||
var processStub = (typeof process === "object" && | ||
typeof process.env === "object") ? process : { env: {} }; | ||
var invariant$1 = invariant; | ||
@@ -64,5 +56,3 @@ | ||
exports.invariant = invariant; | ||
exports.process = processStub; | ||
exports.processStub = processStub; | ||
exports.setVerbosity = setVerbosity; | ||
//# sourceMappingURL=invariant.js.map |
{ | ||
"name": "ts-invariant", | ||
"version": "0.7.5", | ||
"version": "0.8.0", | ||
"author": "Ben Newman <ben@apollographql.com>", | ||
@@ -45,3 +45,3 @@ "description": "TypeScript implementation of invariant(condition, message)", | ||
}, | ||
"gitHead": "ddf99bc9b5e35edadab65779f1248406c8cda12b" | ||
"gitHead": "d21f39c386d41ae6769f48b724c693a2ac0a28a7" | ||
} |
@@ -14,3 +14,6 @@ import typescriptPlugin from 'rollup-plugin-typescript2'; | ||
export default [{ | ||
const jobs = []; | ||
export default jobs; | ||
jobs.push({ | ||
input: "src/invariant.ts", | ||
@@ -30,3 +33,5 @@ external, | ||
], | ||
}, { | ||
}); | ||
jobs.push({ | ||
input: "lib/invariant.esm.js", | ||
@@ -43,2 +48,15 @@ external, | ||
}, | ||
}]; | ||
}); | ||
jobs.push({ | ||
input: "process/module.js", | ||
external, | ||
output: { | ||
file: "process/main.js", | ||
format: "cjs", | ||
exports: "named", | ||
sourcemap: true, | ||
name: "ts-invariant/process", | ||
globals, | ||
}, | ||
}); |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
25788
18
315
0
1