<commit_before>type MergeObject = Record<string, unknown>;

/**
 * Merge two objects
 *
 * Replacement for Object.assign() that is not supported by IE, so it cannot be used in production yet.
 */
export function merge<T>(item1: T, item2?: T, item3?: T): T {
	const result: MergeObject = Object.create(null);
	const items = [item1, item2, item3];

	for (let i = 0; i < 3; i++) {
		const item = items[i];
		if (typeof item === 'object' && item) {
			for (const key in item) {
				result[key] = (item as MergeObject)[key];
			}
		}
	}

	return result as T;
}<commit_msg>Ignore undefined when merging objects<commit_after>type MergeObject = Record<string, unknown>;

/**
 * Merge two objects
 *
 * Replacement for Object.assign() that is not supported by IE, so it cannot be used in production yet.
 */
export function merge<T>(item1: T, item2?: T, item3?: T): T {
	const result: MergeObject = Object.create(null);
	const items = [item1, item2, item3];

	for (let i = 0; i < 3; i++) {
		const item = items[i];
		if (typeof item === 'object' && item) {
			for (const key in item) {
				const value = (item as MergeObject)[key];
				if (value !== void 0) {
					result[key] = value;
				}
			}
		}
	}

	return result as T;
}
{'fraction_non_alphanumeric': 0.1469622331691297, 'fraction_numerical': 0.013957307060755337, 'mean_word_length': 3.4007220216606497, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '5301489', 'n_tokens_mistral': 453, 'n_tokens_neox': 411, 'n_words': 153}