<commit_before>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
*/

"use strict";

/**
 * convert an object into its 2D array equivalent to be turned
 * into an ES6 map
 *
 * @param {object} obj - any object type that works with Object.keys()
 * @returns {Map<TODO, TODO>} an ES6 Map of KV pairs
 */
module.exports = function objectToMap(obj) {
	return new Map(
		Object.keys(obj).map(key => {
			/** @type {[string, string]} */
			const pair = [key, obj[key]];
			return pair;
		})
	);
};
<commit_msg>Simplify objectToMap by using Object.entries<commit_after>/*
	MIT License http://www.opensource.org/licenses/mit-license.php
*/

"use strict";

/**
 * Convert an object into an ES6 map
 *
 * @param {object} obj - any object type that works with Object.entries()
 * @returns {Map<string, any>} an ES6 Map of KV pairs
 */
module.exports = function objectToMap(obj) {
	return new Map(Object.entries(obj));
};

{'fraction_non_alphanumeric': 0.1468682505399568, 'fraction_numerical': 0.005399568034557235, 'mean_word_length': 3.6818181818181817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1323345', 'n_tokens_mistral': 317, 'n_tokens_neox': 304, 'n_words': 98}