<commit_before>import * as fs from 'fs';
import xlsxToParseMap from "./modules/xlsxToParseMap.js"
import xlsxToEngineObject from "./modules/xlsxToEngineObject.js"

function mapToJson(map) {
	return JSON.stringify([...map]);
}

/**
* Testkit settings
* @property {string} sheet ID of the sheet to extract the syntax tests from
* @property {array<string>} omitCols Column headings to ignore when processing the sheet (implies also `rowHeader` as an item)
* @property {string} rowHeader Which column header should be used as the row description / header
* @property {number} [dataRowStart] Row offset to start reading data from, if falsy is calculated as driverRow+1
*/
var settings = {
	sheet: 'fieldCodes',
	omitCols: ['Searching type'],
	includeCols: ['PubMed abbreviation', 'Ovid MEDLINE'],
	rowHeader: 'Explanation',
	dataRowStart: 0,
};

xlsxToParseMap(settings).then(parseMap => {
	fs.writeFileSync(
		'../src/data/fieldCodesParse.js',
		`export default JSON.parse(\`${JSON.stringify(parseMap).replace(/\\/g, "\\\\")}\`)` // Replace \ with \\ to escape \}\`)`
	);
});
<commit_msg>refactor: Removed unused function<commit_after>import * as fs from 'fs';
import xlsxToParseMap from "./modules/xlsxToParseMap.js"
import xlsxToEngineObject from "./modules/xlsxToEngineObject.js"

/**
* Testkit settings
* @property {string} sheet ID of the sheet to extract the syntax tests from
* @property {array<string>} omitCols Column headings to ignore when processing the sheet (implies also `rowHeader` as an item)
* @property {string} rowHeader Which column header should be used as the row description / header
* @property {number} [dataRowStart] Row offset to start reading data from, if falsy is calculated as driverRow+1
*/
var settings = {
	sheet: 'fieldCodes',
	omitCols: ['Searching type'],
	includeCols: ['PubMed abbreviation', 'Ovid MEDLINE'],
	rowHeader: 'Explanation',
	dataRowStart: 0,
};

xlsxToParseMap(settings).then(parseMap => {
	fs.writeFileSync(
		'../src/data/fieldCodesParse.js',
		`export default JSON.parse(\`${JSON.stringify(parseMap).replace(/\\/g, "\\\\")}\`)` // Replace \ with \\ to escape \}\`)`
	);
});

{'fraction_non_alphanumeric': 0.14211764705882354, 'fraction_numerical': 0.0018823529411764706, 'mean_word_length': 4.84065934065934, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2802781', 'n_tokens_mistral': 687, 'n_tokens_neox': 668, 'n_words': 209}