ts-invariant
Advanced tools
Comparing version 0.9.4 to 0.10.0
@@ -0,0 +0,0 @@ export declare class InvariantError extends Error { |
@@ -1,7 +0,2 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var tslib = require('tslib'); | ||
import { __extends } from "tslib"; | ||
var genericMessage = "Invariant Violation"; | ||
@@ -13,3 +8,3 @@ var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { | ||
var InvariantError = /** @class */ (function (_super) { | ||
tslib.__extends(InvariantError, _super); | ||
__extends(InvariantError, _super); | ||
function InvariantError(message) { | ||
@@ -27,3 +22,4 @@ if (message === void 0) { message = genericMessage; } | ||
}(Error)); | ||
function invariant(condition, message) { | ||
export { InvariantError }; | ||
export function invariant(condition, message) { | ||
if (!condition) { | ||
@@ -51,3 +47,3 @@ throw new InvariantError(message); | ||
})(invariant || (invariant = {})); | ||
function setVerbosity(level) { | ||
export function setVerbosity(level) { | ||
var old = verbosityLevels[verbosityLevel]; | ||
@@ -57,8 +53,3 @@ verbosityLevel = Math.max(0, verbosityLevels.indexOf(level)); | ||
} | ||
var invariant$1 = invariant; | ||
exports.InvariantError = InvariantError; | ||
exports['default'] = invariant$1; | ||
exports.invariant = invariant; | ||
exports.setVerbosity = setVerbosity; | ||
//# sourceMappingURL=invariant.js.map | ||
export default invariant; | ||
//# sourceMappingURL=invariant.js.map |
{ | ||
"name": "ts-invariant", | ||
"version": "0.9.4", | ||
"version": "0.10.0", | ||
"author": "Ben Newman <ben@apollographql.com>", | ||
"description": "TypeScript implementation of invariant(condition, message)", | ||
"license": "MIT", | ||
"main": "lib/invariant.js", | ||
"module": "lib/invariant.esm.js", | ||
"type": "module", | ||
"main": "lib/invariant.cjs", | ||
"module": "lib/invariant.js", | ||
"types": "lib/invariant.d.ts", | ||
@@ -28,7 +29,7 @@ "keywords": [ | ||
"rollup": "../../node_modules/.bin/rollup -c", | ||
"mocha": "../../node_modules/.bin/mocha --reporter spec --full-trace lib/tests.js", | ||
"prepublish": "npm run build", | ||
"pretest": "npm run build", | ||
"test": "npm run test:mocha && npm run test:no-node", | ||
"test:mocha": "npm run mocha", | ||
"prepare": "npm run build", | ||
"mocha": "npm run mocha:esm && npm run mocha:cjs", | ||
"mocha:esm": "../../node_modules/.bin/mocha --reporter spec --full-trace lib/tests.js", | ||
"mocha:cjs": "../../node_modules/.bin/mocha --reporter spec --full-trace lib/tests.bundle.cjs", | ||
"test": "npm run build && npm run mocha && npm run test:no-node", | ||
"test:no-node": "! grep -i node lib/invariant.d.ts" | ||
@@ -46,3 +47,3 @@ }, | ||
}, | ||
"gitHead": "84163bbe416bae1221d58f5ce947b43d8f751cb7" | ||
"gitHead": "27183d087df193b4701b160cc9a569205b27cf35" | ||
} |
{ | ||
"name": "ts-invariant/process", | ||
"main": "./main.js", | ||
"type": "module", | ||
"main": "./main.cjs", | ||
"module": "./index.js", | ||
@@ -5,0 +6,0 @@ "types": "./index.d.ts", |
@@ -1,6 +0,5 @@ | ||
import typescriptPlugin from 'rollup-plugin-typescript2'; | ||
import typescript from 'typescript'; | ||
const globals = { | ||
__proto__: null, | ||
assert: "assert", | ||
invariant: "reactInvariant", | ||
tslib: "tslib", | ||
@@ -18,28 +17,23 @@ "@ungap/global-this": "globalThisPolyfill", | ||
jobs.push({ | ||
input: "src/invariant.ts", | ||
input: "lib/invariant.js", | ||
external, | ||
output: { | ||
file: "lib/invariant.esm.js", | ||
format: "esm", | ||
file: "lib/invariant.cjs", | ||
format: "cjs", | ||
exports: "named", | ||
sourcemap: true, | ||
name: "ts-invariant", | ||
globals, | ||
}, | ||
plugins: [ | ||
typescriptPlugin({ | ||
typescript, | ||
tsconfig: "./tsconfig.rollup.json", | ||
}), | ||
], | ||
}); | ||
jobs.push({ | ||
input: "lib/invariant.esm.js", | ||
input: "lib/tests.js", | ||
external, | ||
output: { | ||
// Intentionally overwrite the invariant.js file written by tsc: | ||
file: "lib/invariant.js", | ||
file: "lib/tests.bundle.cjs", | ||
format: "cjs", | ||
exports: "named", | ||
sourcemap: true, | ||
name: "ts-invariant", | ||
name: "ts-invariant-tests-cjs-bundle", | ||
globals, | ||
@@ -53,3 +47,3 @@ }, | ||
output: { | ||
file: "process/main.js", | ||
file: "process/main.cjs", | ||
format: "cjs", | ||
@@ -56,0 +50,0 @@ exports: "named", |
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
Yes
22163
297