nestjs-resilience
Version:
A module for improving the reliability and fault-tolerance of your NestJS applications
21 lines (20 loc) • 537 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Random = void 0;
class Random {
static Between(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
static Boolean() {
return Math.random() >= 0.5;
}
static Array(array) {
return array[Math.floor(Math.random() * array.length)];
}
static String(length) {
return Math.random()
.toString(36)
.substring(2, length + 2);
}
}
exports.Random = Random;
;