Skip to content

Commit

Permalink
Manage boolean values in escapeFormule setting (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
sp94 authored Oct 9, 2023
1 parent 841e1d4 commit f1d10ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions papaparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,10 @@ License: MIT
_escapedQuote = _config.escapeChar + _quoteChar;
}

if (typeof _config.escapeFormulae === 'boolean' || _config.escapeFormulae instanceof RegExp) {
_escapeFormulae = _config.escapeFormulae instanceof RegExp ? _config.escapeFormulae : /^[=+\-@\t\r].*$/;
if (_config.escapeFormulae instanceof RegExp) {
_escapeFormulae = _config.escapeFormulae;
} else if (typeof _config.escapeFormulae === 'boolean' && _config.escapeFormulae) {
_escapeFormulae = /^[=+\-@\t\r].*$/;
}
}

Expand Down

0 comments on commit f1d10ee

Please sign in to comment.