function addRepeatErrorsTo()

in apps/mountebank-mock/mountebank-source/src/models/dryRunValidator.js [171:184]


    function addRepeatErrorsTo (errors, response) {
        const repeat = response.repeat,
            type = typeof repeat,
            error = exceptions.ValidationError('"repeat" field must be an integer greater than 0', {
                source: response
            });

        if (['undefined', 'number', 'string'].indexOf(type) < 0) {
            errors.push(error);
        }
        if ((type === 'string' && parseInt(repeat) <= 0) || (type === 'number' && repeat <= 0)) {
            errors.push(error);
        }
    }