Skip to content

Commit

Permalink
fix; include field data when not matching a pgn (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 authored Jul 25, 2024
1 parent 549edd0 commit 6dfb34f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fromPgn.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ class Parser extends EventEmitter {
} else {
const ts = _.get(pgn, 'timestamp', new Date())
pgn.timestamp = _.isDate(ts) ? ts.toISOString() : ts
if ( !_.isUndefined(value) && (value != null ||
this.options.returnNulls) ) {
pgn.fields[field.Name] = value
}
this.emit('pgn', pgn)
cb && cb(undefined, pgn)
return pgn
Expand Down

0 comments on commit 6dfb34f

Please sign in to comment.