diff --git a/lib/fromPgn.js b/lib/fromPgn.js index 79e416b..66987cc 100644 --- a/lib/fromPgn.js +++ b/lib/fromPgn.js @@ -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