Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
auto_parse = simplify internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jan 9, 2017
1 parent 00ff6d4 commit bd4a2a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/index.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ Implementation of the [`stream.Transform` API][transform]
else
@is_float.test value
auto_parse = (value) =>
if @options.auto_parse and is_int @field
@field = parseInt @field
else if @options.auto_parse and is_float @field
@field = parseFloat @field
if @options.auto_parse and is_int value
value = parseInt value
else if @options.auto_parse and is_float value
value = parseFloat value
else if @options.auto_parse and @options.auto_parse_date
m = Date.parse @field
@field = new Date m unless isNaN m
@field
m = Date.parse value
value = new Date m unless isNaN m
value
is_rem_buf_rowDelimiter = (remainingBuffer, remainingBufferLength) =>
rowDelimiterMatched = false
if @rowDelimiter? # check when rowDelimiter is set to default
Expand Down

0 comments on commit bd4a2a3

Please sign in to comment.