{"size": 698, "ext": "js", "max_stars_repo_path": "src/shared/mediaQueries.js", "max_stars_repo_name": "appbaseio/designkit", "max_stars_repo_stars_event_min_datetime": "2017-12-02T09:17:25.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-17T22:56:54.000Z", "max_issues_repo_path": "src/shared/mediaQueries.js", "max_issues_repo_name": "doc22940/designkit", "max_issues_repo_issues_event_min_datetime": "2017-12-23T00:55:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-14T07:41:19.000Z", "max_forks_repo_path": "src/shared/mediaQueries.js", "max_forks_repo_name": "doc22940/designkit", "max_forks_repo_forks_event_min_datetime": "2018-12-21T10:04:34.000Z", "max_forks_repo_forks_event_max_datetime": "2020-03-13T23:42:40.000Z"}
{"max_stars_count": 14, "max_issues_count": 15, "max_forks_count": 6, "avg_line_length": 21.1515151515, "max_line_length": 61, "alphanum_fraction": 0.6389684814}
const breakpoints = {
	xs: 420,
	sm: 576,
	md: 768,
	lg: 992,
	xl: 1200,
};

function queries(size) {
	return `@media all and (max-width: ${breakpoints[size]}px)`;
}

function toTitleCase(string) {
	return string.replace(
		/\w\S*/g,
		txt => txt.charAt(0).toUpperCase() + txt.substr(1),
	);
}

const sizeOrder = ['sm', 'md', 'lg', 'xl'];
const getProperty = (props, property, size) => {
	if (props[`${size}${toTitleCase(property)}`]) {
		return props[`${size}${toTitleCase(property)}`];
	} else if (size === 'xl') {
		return props[property];
	}
	const index = sizeOrder.indexOf(size);
	return getProperty(props, property, sizeOrder[index + 1]);
};

export default queries;
export { getProperty };
