{"version":3,"file":"invariant.cjs.development.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":["invariant","condition","format","args","undefined","Error","error","argIndex","replace","name","framesToPop"],"mappings":";;AAAA;;;;;;;;;;AAWA,SAAgBA,UAAUC,WAAgBC;oCAAmBC;IAAAA;;;EAChB;QACrCD,MAAM,KAAKE,SAAf,EAA0B;YAClB,IAAIC,KAAJ,CAAU,8CAAV,CAAN;;;;MAIA,CAACJ,SAAL,EAAgB;QACVK,KAAJ;;QACIJ,MAAM,KAAKE,SAAf,EAA0B;MACxBE,KAAK,GAAG,IAAID,KAAJ,CACN,uEACE,6DAFI,CAAR;KADF,MAKO;UACDE,QAAQ,GAAG,CAAf;MACAD,KAAK,GAAG,IAAID,KAAJ,CACNH,MAAM,CAACM,OAAP,CAAe,KAAf,EAAsB;eACbL,IAAI,CAACI,QAAQ,EAAT,CAAX;OADF,CADM,CAAR;MAKAD,KAAK,CAACG,IAAN,GAAa,qBAAb;;;IAGDH,KAAa,CAACI,WAAd,GAA4B,CAA5B,CAjBa;;UAkBRJ,KAAN;;;;;;"}