@sports-alliance/sports-lib 7.1.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.EventImporterFIT = void 0;
|
|
16
13
|
const event_1 = require("../../../event");
|
|
@@ -138,14 +135,14 @@ const data_avg_grit_1 = require("../../../../data/data.avg-grit");
|
|
|
138
135
|
const data_jump_event_1 = require("../../../../data/data.jump-event");
|
|
139
136
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
140
137
|
// @ts-ignore
|
|
141
|
-
const
|
|
138
|
+
const FitFileParser = require('fit-file-parser').default;
|
|
142
139
|
// Threshold to detect that session.timestamp are not trustable (when exceeding 15% of session.total_elapsed_time)
|
|
143
140
|
const INVALID_DATES_ELAPSED_TIME_RATIO_THRESHOLD = 1.15;
|
|
144
141
|
class EventImporterFIT {
|
|
145
142
|
static getFromArrayBuffer(arrayBuffer_1) {
|
|
146
143
|
return __awaiter(this, arguments, void 0, function* (arrayBuffer, options = activity_parsing_options_1.ActivityParsingOptions.DEFAULT, name = 'New Event') {
|
|
147
144
|
return new Promise((resolve, reject) => {
|
|
148
|
-
const fitFileParser = new
|
|
145
|
+
const fitFileParser = new FitFileParser({
|
|
149
146
|
force: true,
|
|
150
147
|
speedUnit: 'm/s',
|
|
151
148
|
lengthUnit: 'm',
|
package/lib/esm/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/data/data.interface.ts
|
|
2
9
|
var UnitSystem = /* @__PURE__ */ ((UnitSystem2) => {
|
|
3
10
|
UnitSystem2[UnitSystem2["Metric"] = 0] = "Metric";
|
|
@@ -9846,7 +9853,7 @@ var ImporterFitDevelopmentDeviceNames = {
|
|
|
9846
9853
|
};
|
|
9847
9854
|
|
|
9848
9855
|
// src/events/adapters/importers/fit/importer.fit.ts
|
|
9849
|
-
|
|
9856
|
+
var FitFileParser = __require("fit-file-parser").default;
|
|
9850
9857
|
var INVALID_DATES_ELAPSED_TIME_RATIO_THRESHOLD = 1.15;
|
|
9851
9858
|
var EventImporterFIT = class {
|
|
9852
9859
|
static async getFromArrayBuffer(arrayBuffer, options = ActivityParsingOptions.DEFAULT, name = "New Event") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sports-alliance/sports-lib",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gpx",
|