UNPKG

mathball

Version:

A JavaScript library for Competitive Programming

9 lines (7 loc) 320 B
'use strict'; //validate integer or object module.exports = function (arg, func) { if (typeof arg === 'boolean' || typeof arg === 'string' || arg.constructor === Array) { throw new TypeError('Invalid argument received: ' + JSON.stringify(arg) + '\n\'' + func + '()\' only accepts an integer or an object!\n'); } };