@onflow/util-invariant
Advanced tools
Comparing version 1.2.0-alpha.0 to 1.2.0-typescript.0
# @onflow/util-invariant | ||
## 1.2.0-alpha.0 | ||
## 1.2.0-typescript.0 | ||
### Minor Changes | ||
- TS build | ||
- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript | ||
- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build | ||
## 1.1.0 | ||
@@ -10,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-typescript.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-typescript.0", | ||
"@onflow/types": "^1.2.0-typescript.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
14540
15
111
0
9