coffee-gen
Version:
One more cup of coffee for the road
26 lines • 954 B
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const uuid = __importStar(require("uuid"));
class FunctionGenerators {
static getRandomIntFunction(min = 1, max = 10) {
const low = Math.floor(min);
const high = Math.floor(max);
return () => low + Math.floor(Math.random() * (high - low));
}
static getRandomIntStringFunction(min = 1, max = 10) {
const f = this.getRandomIntFunction(min, max);
return () => f().toString();
}
static getRandomUUID() {
return () => uuid.v4();
}
}
exports.FunctionGenerators = FunctionGenerators;
//# sourceMappingURL=functionGenerators.js.map