UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif

17 lines (13 loc) 297 B
/** * Log a console.warn message only once */ export const warnOnce = (() => { const messages = {} return function warnOnce (...args) { const message = args.join(', ') if (!messages[message]) { messages[message] = true console.warn('Warning:', ...args) } } })()