Skip to content

Commit ea0e89d

Browse files
authored
enh: update parser key generation condition for typecast
Add more robust check for generating key for parser caching for the field `tyepCast` to ensure value is used for only boolean input. Also removed `test-typecast-dual-connections.test.cjs` as existing testcases are sufficient.
1 parent 63d6570 commit ea0e89d

File tree

2 files changed

+1
-70
lines changed

2 files changed

+1
-70
lines changed

lib/parsers/parser_cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function keyFromFields(type, fields, options, config) {
1414
Boolean(options.rowsAsArray),
1515
Boolean(options.supportBigNumbers || config.supportBigNumbers),
1616
Boolean(options.bigNumberStrings || config.bigNumberStrings),
17-
typeof options.typeCast === 'function' ? 'function' : options.typeCast,
17+
typeof options.typeCast === 'boolean' ? options.typeCast : typeof options.typeCast,
1818
options.timezone || config.timezone,
1919
Boolean(options.decimalNumbers),
2020
options.dateStrings,

test/integration/config/test-typecast-dual-connections.test.cjs

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)