quantified-self-lib
Advanced tools
Comparing version 1.0.0-pre-4 to 1.0.0-pre-5
import { EventExporterInterface } from './exporter.interface'; | ||
import { EventInterface } from '../../event.interface'; | ||
export declare class EventExporterTCX implements EventExporterInterface { | ||
private xmlSerializer; | ||
readonly fileType: string; | ||
@@ -6,0 +5,0 @@ readonly fileExtension: string; |
@@ -13,3 +13,2 @@ "use strict"; | ||
function EventExporterTCX() { | ||
this.xmlSerializer = new XMLSerializer(); | ||
this.fileType = 'application/tcx'; | ||
@@ -73,6 +72,17 @@ this.fileExtension = 'tcx'; | ||
var totalTimeInSecondsElement = document.createElementNS('http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2', 'TotalTimeSeconds'); | ||
totalTimeInSecondsElement.textContent = lap.getDuration().getValue().toString(); | ||
// @todo fix | ||
if (lap.getDuration()) { | ||
totalTimeInSecondsElement.textContent = lap.getDuration().getValue().toString(); | ||
} | ||
else { | ||
totalTimeInSecondsElement.textContent = '0'; | ||
} | ||
lapElement.appendChild(totalTimeInSecondsElement); | ||
var distanceInMetersElement = document.createElementNS('http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2', 'DistanceMeters'); | ||
distanceInMetersElement.textContent = lap.getDistance().getValue().toString(); | ||
if (lap.getDistance()) { | ||
distanceInMetersElement.textContent = lap.getDistance().getValue().toString(); | ||
} | ||
else { | ||
distanceInMetersElement.textContent = '0'; | ||
} | ||
lapElement.appendChild(distanceInMetersElement); | ||
@@ -175,3 +185,3 @@ var caloriesInKCALElement = document.createElementNS('http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2', 'Calories'); | ||
} | ||
return '<?xml version="1.0" encoding="UTF-8"?>' + this.xmlSerializer.serializeToString(xmlDocument); | ||
return '<?xml version="1.0" encoding="UTF-8"?>' + xmlDocument.documentElement.outerHTML; | ||
}; | ||
@@ -178,0 +188,0 @@ EventExporterTCX.prototype.getfileExtension = function () { |
{ | ||
"name": "quantified-self-lib", | ||
"version": "1.0.0-pre-4", | ||
"version": "1.0.0-pre-5", | ||
"description": "A utility lib to work with tcx, fit and Suunto files", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,1 +0,13 @@ | ||
# quantified-self-lib | ||
# Quantified Self Lib | ||
Master | ||
[![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) | ||
Develop | ||
[![codebeat badge](https://codebeat.co/badges/f39e837c-2885-47bb-94b3-a8718ad561a6)](https://codebeat.co/projects/github-com-jimmykane-quantified-self-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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243790
5085
14