UNPKG

mathball

Version:

A JavaScript library for Competitive Programming

9 lines (7 loc) 308 B
'use strict'; /* * Integer Validation */ module.exports = function (arg, func) { if (typeof arg != 'number' || arg + 1 == arg || arg != arg || !Number.isInteger(arg)) throw new TypeError('Invalid argument received: ' + JSON.stringify(arg) + '\n\'' + func + '()\' only accept a positive integer!\n'); };