{"size": 690, "ext": "js", "max_stars_repo_path": "lib/matchers/inRange.js", "max_stars_repo_name": "mattwynne/hamjest", "max_stars_repo_stars_event_min_datetime": "2015-01-31T09:57:33.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-23T17:43:29.000Z", "max_issues_repo_path": "lib/matchers/inRange.js", "max_issues_repo_name": "mattwynne/hamjest", "max_issues_repo_issues_event_min_datetime": "2015-01-07T16:03:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-02T04:32:32.000Z", "max_forks_repo_path": "lib/matchers/inRange.js", "max_forks_repo_name": "mattwynne/hamjest", "max_forks_repo_forks_event_min_datetime": "2016-02-22T07:25:45.000Z", "max_forks_repo_forks_event_max_datetime": "2020-03-19T10:12:22.000Z"}
{"max_stars_count": 69, "max_issues_count": 41, "max_forks_count": 12, "avg_line_length": 19.7142857143, "max_line_length": 58, "alphanum_fraction": 0.6057971014}
'use strict';

const _ = require('lodash');

module.exports = function (start, end) {
	const __ = require('../..');

	if (_.isUndefined(end)) {
		end = start;
		start = 0;
	}

	__.assertThat('Start', start, __.is(__.number()));
	__.assertThat('End', end, __.is(__.number()));

	return _.create(__.number(), {
		matchesSafely: function (actual) {
			return _.inRange(actual, start, end);
		},
		describeTo: function (description) {
			description
				.append('a number in range [')
				.append(start)
				.append(', ')
				.append(end)
				.append(')');
		},
		describeMismatchSafely: function (actual, description) {
			description
				.append('was ')
				.appendValue(actual);
		}
	});
};
