UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

19 lines (18 loc) 560 B
//#region src/utils/invariant.ts const invariant = function invariant(condition, format, ...args) { if (!condition) { let error; if (format === void 0) error = /* @__PURE__ */ new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); else { let index = 0; const message = format.replace(/%s/g, () => { return args[index++]; }); error = new Error(message); error.name = "Invariant Violation"; } throw error; } }; //#endregion export { invariant };