function quoteCell(cell, { quote = '"', separator = ",", quoteables } = {
        quote: '"',
        separator: ",",
        quoteables: [quote, separator, '\r', '\n']
    }) {
    quoteables = quoteables || [quote, separator, '\r', '\n'];

    let doubleUp = false;
    if (cell.indexOf(quote) !== -1) { // add double quotes if any quotes
        doubleUp = true;
    }
    const quoteChar = quoteables.some(q => cell.includes(q)) ? quote : '';
    return quoteChar + (doubleUp ? cell.replace(/"/g, '""') : cell) + quoteChar;
}
Quotes a cell in a CSV string if necessary. Addiionally, any double quotes inside the cell will be escaped as per RFC 4180 2.6 (https://datatracker.ietf.org/doc/html/rfc4180#section-2).
@param {string} cell - the string to quote
@param {*} options - options
@param {string} [options.quote='"'] - the quote character
@param {string} [options.separator=','] - the separator character
@param {string[]} [options.quoteables] - an array of characters that, when encountered, will trigger the application of outer quotes
@returns