1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1× 95× 5× 5× 5× 5× 1× | // Inspired by Facebook's invariant // https://github.com/facebook/react/blob/v0.13.3/src/vendor/core/invariant.js function invariant(condition, message) { if (!condition) { const error = new Error(message); error.name = 'Invariant Violation'; Error.captureStackTrace(error, invariant); // Remove this function's frame from the stack throw error; } } module.exports = invariant; |