<commit_before>// @flow

import {buildDeptString} from './build-dept'

/**
 * Builds a deptnum string from a course.
 *
 * @param {Course} course - the course
 * @param {Boolean} includeSection - whether or not to include the section in the result
 * @returns {String} - the deptnum string
 */
export function buildDeptNum(
	{
		departments,
		number,
		section = '',
		deptnum,
	}: {
		departments: string[],
		number: number,
		section?: string,
		deptnum?: string,
	},
	includeSection?: boolean = false,
) {
	const dept = buildDeptString(departments)
	const deptnumString = deptnum || `${dept} ${number}`

	if (includeSection) {
		return `${deptnumString}${section}`
	}

	return deptnumString
}<commit_msg>inline a destructuring in buildDeptNum<commit_after>// @flow

import {buildDeptString} from './build-dept'

/**
 * Builds a deptnum string from a course.
 *
 * @param {Course} course - the course
 * @param {Boolean} includeSection - whether or not to include the section in the result
 * @returns {String} - the deptnum string
 */
export function buildDeptNum(
	course: {
		departments: string[],
		number: number,
		section?: string,
		deptnum?: string,
	},
	includeSection?: boolean = false,
) {
	let {departments, number, section = '', deptnum} = course

	const dept = buildDeptString(departments)
	const deptnumString = deptnum || `${dept} ${number}`

	if (includeSection) {
		return `${deptnumString}${section}`
	}

	return deptnumString
}
{'fraction_non_alphanumeric': 0.1307639366827254, 'fraction_numerical': 0.0, 'mean_word_length': 4.192857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '372919', 'n_tokens_mistral': 498, 'n_tokens_neox': 479, 'n_words': 143}