UNPKG

@onesy/utils

Version:
12 lines (11 loc) 479 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const is_1 = __importDefault(require("./is")); const random = (min = 1, max = 1e1) => { if ((0, is_1.default)('number', min) && (0, is_1.default)('number', max)) return min + Math.floor(Math.random() * ((max - min) + 1)); }; exports.default = random;