{"version":3,"file":"invariant.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nexport function invariant(condition: any, format: string, ...args: any[]) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n let error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n let argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() {\n return args[argIndex++];\n })\n );\n error.name = 'Invariant Violation';\n }\n\n (error as any).framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n"],"names":["condition","format","args","error","undefined","Error","argIndex","replace","name","framesToPop"],"mappings":"wCAW0BA,EAAgBC,8BAAmBC,mCAAAA,wBAOtDF,EAAW,KACVG,UACWC,IAAXH,EACFE,EAAQ,IAAIE,MACV,qIAGG,KACDC,EAAW,GACfH,EAAQ,IAAIE,MACVJ,EAAOM,QAAQ,OAAO,kBACbL,EAAKI,UAGVE,KAAO,4BAGdL,EAAcM,YAAc,EACvBN"}