@onflow/util-invariant
Advanced tools
Comparing version 1.2.0-alpha.0 to 1.2.0
# @onflow/util-invariant | ||
## 1.2.0 | ||
### Minor Changes | ||
- [#1728](https://github.com/onflow/fcl-js/pull/1728) [`a4f8c00c`](https://github.com/onflow/fcl-js/commit/a4f8c00c4cf292d3a4afac610dedbc89ff3affea) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build | ||
- [#1750](https://github.com/onflow/fcl-js/pull/1750) [`845ffa75`](https://github.com/onflow/fcl-js/commit/845ffa756e07188557d150cdb9ff7af59019a477) Thanks [@jribbink](https://github.com/jribbink)! - Convert to Typescript | ||
## 1.2.0-alpha.0 | ||
@@ -4,0 +12,0 @@ |
@@ -7,17 +7,16 @@ 'use strict'; | ||
* Asserts fact is true, otherwise throw an error with invariant message | ||
* @param {boolean} fact | ||
* @param {string} msg | ||
* @param {Array} rest | ||
* @returns {void} | ||
* @param fact | ||
* @param msg | ||
* @param rest | ||
*/ | ||
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; | ||
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; | ||
} | ||
} | ||
@@ -24,0 +23,0 @@ |
/** | ||
* Asserts fact is true, otherwise throw an error with invariant message | ||
* @param {boolean} fact | ||
* @param {string} msg | ||
* @param {Array} rest | ||
* @returns {void} | ||
* @param fact | ||
* @param msg | ||
* @param rest | ||
*/ | ||
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; | ||
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; | ||
} | ||
} | ||
@@ -19,0 +18,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, ...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; | ||
} | ||
/** | ||
* Asserts fact is true, otherwise throw an error with invariant message | ||
* @param fact | ||
* @param msg | ||
* @param rest | ||
*/ | ||
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; | ||
} | ||
} | ||
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.2.0-alpha.0", | ||
"version": "1.2.0", | ||
"description": "Flow JS SDK Util -- Invariant", | ||
@@ -16,4 +16,10 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@onflow/fcl-bundle": "^1.4.0-alpha.0", | ||
"@onflow/types": "^1.2.0-alpha.0", | ||
"@babel/preset-typescript": "^7.22.5", | ||
"@onflow/fcl-bundle": "^1.4.0", | ||
"@onflow/types": "^1.2.0", | ||
"@types/jest": "^29.5.3", | ||
"@typescript-eslint/eslint-plugin": "^6.4.0", | ||
"@typescript-eslint/parser": "^6.4.0", | ||
"eslint": "^8.47.0", | ||
"eslint-plugin-jsdoc": "^46.4.6", | ||
"jest": "^29.5.0" | ||
@@ -25,3 +31,3 @@ }, | ||
"unpkg": "dist/util-invariant.umd.js", | ||
"types": "dist/types/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
@@ -28,0 +34,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
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
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
14542
15
111
0
0
9