UNPKG

higher-order-reducers

Version:

A library of simple everyday reducer utility functions

27 lines (26 loc) 723 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = warn; /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warn(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ }