quantified-self-lib
Advanced tools
Comparing version 1.0.0-pre-6 to 1.0.0-pre-7
@@ -17,3 +17,7 @@ "use strict"; | ||
function DataNumber(value) { | ||
var _this = _super.call(this, value) || this; | ||
var _this = this; | ||
if (typeof value !== 'number') { | ||
throw new Error('Only numbers are allowed for numeric data'); | ||
} | ||
_this = _super.call(this, value) || this; | ||
_this.value = value; | ||
@@ -20,0 +24,0 @@ return _this; |
@@ -73,2 +73,3 @@ "use strict"; | ||
}); | ||
activity.sortPointsByDate(); | ||
event.addActivity(activity); | ||
@@ -75,0 +76,0 @@ }); |
@@ -73,7 +73,7 @@ "use strict"; | ||
// Add lat long | ||
point.addData(new data_latitude_degrees_1.DataLatitudeDegrees(trackPoint.lat)); | ||
point.addData(new data_longitude_degrees_1.DataLongitudeDegrees(trackPoint.lon)); | ||
point.addData(new data_latitude_degrees_1.DataLatitudeDegrees(Number(trackPoint.lat))); | ||
point.addData(new data_longitude_degrees_1.DataLongitudeDegrees(Number(trackPoint.lon))); | ||
// Check if elevation is available and add it | ||
if (trackPoint.ele) { | ||
point.addData(new data_altitude_1.DataAltitude(trackPoint.ele[0])); | ||
point.addData(new data_altitude_1.DataAltitude(Number(trackPoint.ele[0]))); | ||
} | ||
@@ -80,0 +80,0 @@ // Go over the extensions |
@@ -107,3 +107,3 @@ "use strict"; | ||
EventUtilities.getEventDataTypeGainOrLoss = function (gain, event, dataType, starDate, endDate, activities, minDiff) { | ||
if (minDiff === void 0) { minDiff = 1; } | ||
if (minDiff === void 0) { minDiff = 5; } | ||
var gainOrLoss = 0; | ||
@@ -129,3 +129,3 @@ var points = event.getPoints(starDate, endDate, activities); | ||
// if not eligible check if smaller without the diff and if yes do not register it and send it back as the last to check against | ||
if (previousDataType.getValue() <= nextDataType.getValue()) { | ||
if (previousDataType.getValue() < nextDataType.getValue()) { | ||
return previous; | ||
@@ -141,3 +141,3 @@ } | ||
// if not eligible check if smaller without the diff and if yes do not register it and send it back as the last to check against | ||
if (previousDataType.getValue() >= nextDataType.getValue()) { | ||
if (previousDataType.getValue() > nextDataType.getValue()) { | ||
return previous; | ||
@@ -144,0 +144,0 @@ } |
{ | ||
"name": "quantified-self-lib", | ||
"version": "1.0.0-pre-6", | ||
"version": "1.0.0-pre-7", | ||
"description": "A utility lib to work with gpx, tcx, fit and Suunto files", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,11 +5,10 @@ # Quantified Self Lib | ||
[![codebeat badge](https://codebeat.co/badges/e99f7c8a-3b7a-4d5b-9034-2dfd38c0e0a3)](https://codebeat.co/projects/github-com-jimmykane-quantified-self-develop) | ||
[![codebeat badge](https://codebeat.co/badges/e99f7c8a-3b7a-4d5b-9034-2dfd38c0e0a3)](https://codebeat.co/projects/github-com-jimmykane-quantified-self-lib-develop) | ||
[![Build Status](https://travis-ci.org/jimmykane/quantified-self-lib.svg?branch=master)](https://travis-ci.org/jimmykane/quantified-self-lib.svg?branch=master) | ||
[![codecov](https://codecov.io/gh/jimmykane/quantified-self-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/jimmykane/quantified-self) | ||
[![codecov](https://codecov.io/gh/jimmykane/quantified-self-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/jimmykane/quantified-self-lib) | ||
Develop | ||
[![codebeat badge](https://codebeat.co/badges/f39e837c-2885-47bb-94b3-a8718ad561a6)](https://codebeat.co/projects/github-com-jimmykane-quantified-self-develop) | ||
[![codebeat badge](https://codebeat.co/badges/f39e837c-2885-47bb-94b3-a8718ad561a6)](https://codebeat.co/projects/github-com-jimmykane-quantified-self-lib-develop) | ||
[![Build Status](https://travis-ci.org/jimmykane/quantified-self-lib.svg?branch=develop)](https://travis-ci.org/jimmykane/quantified-self-lib.svg?branch=develop) | ||
[![codecov](https://codecov.io/gh/jimmykane/quantified-self-lib/branch/develop/graph/badge.svg)](https://codecov.io/gh/jimmykane/quantified-self) | ||
[![codecov](https://codecov.io/gh/jimmykane/quantified-self-lib/branch/develop/graph/badge.svg)](https://codecov.io/gh/jimmykane/quantified-self-lib) |
253180
5260
14