@onflow/util-invariant
Advanced tools
Comparing version 1.1.0 to 1.2.0-alpha.0
# @onflow/util-invariant | ||
## 1.2.0-alpha.0 | ||
### Minor Changes | ||
- TS build | ||
## 1.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -12,12 +12,12 @@ 'use strict'; | ||
*/ | ||
function invariant(fact, msg) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack.split("\n").filter(d => !/at invariant/.test(d)).join("\n"); | ||
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
rest[_key - 2] = arguments[_key]; | ||
function invariant(fact, msg, ...rest) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack | ||
.split("\n") | ||
.filter(d => !/at invariant/.test(d)) | ||
.join("\n"); | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
} | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
} | ||
} | ||
@@ -24,0 +24,0 @@ |
@@ -8,12 +8,12 @@ /** | ||
*/ | ||
function invariant(fact, msg) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack.split("\n").filter(d => !/at invariant/.test(d)).join("\n"); | ||
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
rest[_key - 2] = arguments[_key]; | ||
function invariant(fact, msg, ...rest) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack | ||
.split("\n") | ||
.filter(d => !/at invariant/.test(d)) | ||
.join("\n"); | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
} | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
} | ||
} | ||
@@ -20,0 +20,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["onflowUtil-invariant"] = {})); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["onflowUtil-invariant"] = {})); | ||
})(this, (function (exports) { 'use strict'; | ||
/** | ||
* Asserts fact is true, otherwise throw an error with invariant message | ||
* @param {boolean} fact | ||
* @param {string} msg | ||
* @param {Array} rest | ||
* @returns {void} | ||
*/ | ||
function invariant(fact, msg) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack.split("\n").filter(d => !/at invariant/.test(d)).join("\n"); | ||
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
rest[_key - 2] = arguments[_key]; | ||
} | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
/** | ||
* Asserts fact is true, otherwise throw an error with invariant message | ||
* @param {boolean} fact | ||
* @param {string} msg | ||
* @param {Array} rest | ||
* @returns {void} | ||
*/ | ||
function invariant(fact, msg, ...rest) { | ||
if (!fact) { | ||
const error = new Error(`INVARIANT ${msg}`); | ||
error.stack = error.stack | ||
.split("\n") | ||
.filter(d => !/at invariant/.test(d)) | ||
.join("\n"); | ||
console.error("\n\n---\n\n", error, "\n\n", ...rest, "\n\n---\n\n"); | ||
throw error; | ||
} | ||
} | ||
} | ||
exports.invariant = invariant; | ||
exports.invariant = invariant; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=util-invariant.umd.js.map |
{ | ||
"name": "@onflow/util-invariant", | ||
"version": "1.1.0", | ||
"version": "1.2.0-alpha.0", | ||
"description": "Flow JS SDK Util -- Invariant", | ||
@@ -16,10 +16,11 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@onflow/fcl-bundle": "^1.3.0", | ||
"@onflow/types": "^1.1.0", | ||
"@onflow/fcl-bundle": "^1.4.0-alpha.0", | ||
"@onflow/types": "^1.2.0-alpha.0", | ||
"jest": "^29.5.0" | ||
}, | ||
"source": "src/index.js", | ||
"source": "src/index.ts", | ||
"main": "dist/util-invariant.js", | ||
"module": "dist/util-invariant.module.js", | ||
"unpkg": "dist/util-invariant.umd.js", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
@@ -26,0 +27,0 @@ "prepublishOnly": "npm test && npm run build", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13
87
11923
1
1