Skip to content

Commit

Permalink
fix(gtfsplus): trim extra spaces from fields
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-heppner-ibigroup committed Nov 23, 2021
1 parent 36e854c commit fca58ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/gtfsplus/reducers/gtfsplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import update from 'react-addons-update'

import {constructNewGtfsPlusRow} from '../util'

import type {Action} from '../../types/actions'
import type {GtfsPlusReducerState} from '../../types/reducers'

Expand Down Expand Up @@ -58,7 +57,7 @@ const gtfsplus = (
continue
}
const fields = lines[0].split(',')
const COLUMN_REGEX = /,(?=(?:(?:[^"]*"){2})*[^"]*$)/
const COLUMN_REGEX = / *, *(?=(?:(?:[^"]*"){2})*[^"]*$)/
const tableName = filename.split('.')[0]
newTableData[tableName] = lines.slice(1)
// Do not include blank lines (e.g., at the end of the file).
Expand Down

0 comments on commit fca58ae

Please sign in to comment.