Skip to content

Commit

Permalink
feature: Added other messages recognition, included events in activit…
Browse files Browse the repository at this point in the history
…y object if cascade mode. Fixes #3
  • Loading branch information
pierremtb committed May 17, 2016
1 parent 121a252 commit c2fb678
Show file tree
Hide file tree
Showing 5 changed files with 42,244 additions and 42,165 deletions.
2 changes: 1 addition & 1 deletion dist/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function readRecord(blob, messageTypes, startIndex, options, startDate) {
var scale = _message$getAttribute2.scale;
var offset = _message$getAttribute2.offset;

if (field !== 'unknown' && field !== '') {
if (field !== 'unknown' && field !== '' && field !== undefined) {
fields[field] = applyOptions(formatByType(data, type, scale, offset), field, options);
}

Expand Down
11 changes: 9 additions & 2 deletions dist/easy-fit.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,21 @@ var EasyFit = function () {
}
break;
default:
if (messageType !== '') {
fitObj[messageType] = message;
}
break;
}
}

if (isModeCascade) {
fitObj = { sessions: sessions, events: events };
fitObj.activity.sessions = sessions;
fitObj.activity.events = events;
} else {
fitObj = { sessions: sessions, laps: laps, records: records, events: events };
fitObj.sessions = sessions;
fitObj.laps = laps;
fitObj.records = records;
fitObj.events = events;
}

callback(null, fitObj);
Expand Down
Loading

0 comments on commit c2fb678

Please sign in to comment.