@workers-utils/common
Advanced tools
Comparing version
import { utilFormat } from './utilFormat.js'; | ||
export function invariant(condition, message, ...args) { | ||
if (!condition) { | ||
if (typeof message === 'string') { | ||
throw new Error(utilFormat(message, ...args)); | ||
if (typeof message === 'function') { | ||
throw new message(...args); | ||
} | ||
throw new message(...args); | ||
throw new Error(utilFormat(message, ...args)); | ||
} | ||
@@ -9,0 +9,0 @@ } |
{ | ||
"name": "@workers-utils/common", | ||
"version": "0.0.0-canary-20241210053457", | ||
"version": "0.0.0-canary-20241210060829", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32992
0.01%