/*
CSV Parse

Please look at the [project documentation](https://csv.js.org/parse/) for
additional information.
*/

/* WEBPACK VAR INJECTION */

/* harmony default export */

/* harmony export (binding) */

/* harmony import */

/* this.options.columns !== true && */

/*#__PURE__*/

/**
 * Iterates through children that are "valid elements".
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child with the index reflecting the position relative to "valid components".
 */

/**
 * Iterates through children that are typically specified as `props.children`,
 * but only maps over children that are "valid elements".
 *
 * The mapFunction provided index will be normalised to the components mapped,
 * so an invalid component would not increase the index.
 *
 */

/***/

//   // return !isNaN( parseInt( obj ) );

//   // return Number.isInteger(parseInt(value))

//   return /^(\-|\+)?[1-9][0-9]*$/.test(value)

// 1 is for escape.length

// 1 is for quote.length

// Activate records emition if above from_line

// Auto discovery of record_delimiter, unix, mac and windows supported

// Borrowed from jquery

// CSV_INVALID_RECORD_LENGTH_DONT_MATCH_COLUMNS

// Central parser implementation

// Convert the first line into column names

// Dont loose time calling cast

// Ensure we are not ending in a quoting state

// Escape a quote

// Escape is only active inside quoted fields

// Fields in the first line are converted as-is to columns

// Give a chance for events to be registered later

// Great, nothing to do

// Handle UTF BOM

// Handle empty string

// Helper to test if a character is a space or a line delimiter

// Implementation of `Transform._flush`

// Implementation of `Transform._transform`

// In relax mode, treat opening quote preceded by chrs as regular

// Increment record length if record size must not exceed a limit

// Keep it in case we implement the `cast_int` option

// Merge with user options

// No enough data

// Normalize option `bom`

// Normalize option `cast_date`

// Normalize option `cast`

// Normalize option `columns_duplicates_to_array`

// Normalize option `columns`

// Normalize option `comment`

// Normalize option `delimiter`

// Normalize option `escape`

// Normalize option `from_line`

// Normalize option `from`

// Normalize option `info`

// Normalize option `ltrim`

// Normalize option `max_record_size`

// Normalize option `objname`

// Normalize option `on_record`

// Normalize option `quote`

// Normalize option `raw`

// Normalize option `record_delimiter`

// Normalize option `relax_column_count`

// Normalize option `relax`

// Normalize option `rtrim`

// Normalize option `skip_empty_lines`

// Normalize option `skip_lines_with_empty_values`

// Normalize option `skip_lines_with_error`

// Normalize option `to_line`

// Normalize option `to`

// Normalize option `trim`

// Normalize options `trim`, `ltrim` and `rtrim`

// Not currently escaping and chr is a quote

// Previous char was a valid escape char

// Return a tuple with the error and the casted value

// Short circuit for the from_line options

// Skip BOM

// Skip full comment line

// Skip if line is empty and skip_empty_lines activated

// Skip if the remaining buffer can be delimiter

// Skip if the remaining buffer can be escape sequence

// Skip if the remaining buffer can be row delimiter following the closing quote

// Skip if the remaining buffer smaller than comment

// Skip if the remaining buffer smaller than row delimiter

// Skip last line if it has no characters

// TODO: need to compare bytes instead of single char

// Transform record array to an object

// Treat next char as a regular character

// Turn duplicate columns into an array

// Wait for more data

// We are quoting, the char is an escape chr and there is a chr to escape

// __isInt(value){

// and this field can't be associated to a key present in columns

// because the final record is an object

// continue

// obj[columns[i].name] = record[i]

// rename columns

// rtrim in non quoting is handle in __onField

// skip BOM detect because data length < 3

// treat the current char as a regular char

// }
