mongo-seeding-cli
Version:
The ultimate command line tool for populating your MongoDB database.
12 lines • 511 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.throwOnNegativeNumber = void 0;
const throwOnNegativeNumber = (variable, name) => {
if (typeof variable !== 'undefined' && (isNaN(variable) || variable < 0)) {
const error = new Error(`Value of '${name}' parameter should be a positive number`);
error.name = 'InvalidParameterError';
throw error;
}
};
exports.throwOnNegativeNumber = throwOnNegativeNumber;
//# sourceMappingURL=validators.js.map