UNPKG

@sports-alliance/sports-lib

Version:

A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc

42 lines (41 loc) 3.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActivityParsingOptions = void 0; class ActivityParsingOptions { constructor(options = {}) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13; this.streams = { smooth: { altitudeSmooth: (_c = (_b = (_a = options.streams) === null || _a === void 0 ? void 0 : _a.smooth) === null || _b === void 0 ? void 0 : _b.altitudeSmooth) !== null && _c !== void 0 ? _c : true, grade: (_f = (_e = (_d = options.streams) === null || _d === void 0 ? void 0 : _d.smooth) === null || _e === void 0 ? void 0 : _e.grade) !== null && _f !== void 0 ? _f : true, gradeSmooth: (_j = (_h = (_g = options.streams) === null || _g === void 0 ? void 0 : _g.smooth) === null || _h === void 0 ? void 0 : _h.gradeSmooth) !== null && _j !== void 0 ? _j : true }, fixAbnormal: { speed: (_m = (_l = (_k = options.streams) === null || _k === void 0 ? void 0 : _k.fixAbnormal) === null || _l === void 0 ? void 0 : _l.speed) !== null && _m !== void 0 ? _m : false } }; if ((_o = options.streams) === null || _o === void 0 ? void 0 : _o.includeTypes) { this.streams.includeTypes = [...options.streams.includeTypes]; } this.tss = { overrides: { functionalThresholdPower: (_q = (_p = options.tss) === null || _p === void 0 ? void 0 : _p.overrides) === null || _q === void 0 ? void 0 : _q.functionalThresholdPower, functionalThresholdPace: (_s = (_r = options.tss) === null || _r === void 0 ? void 0 : _r.overrides) === null || _s === void 0 ? void 0 : _s.functionalThresholdPace, lactateThresholdHR: (_u = (_t = options.tss) === null || _t === void 0 ? void 0 : _t.overrides) === null || _u === void 0 ? void 0 : _u.lactateThresholdHR, maxHeartRate: (_w = (_v = options.tss) === null || _v === void 0 ? void 0 : _v.overrides) === null || _w === void 0 ? void 0 : _w.maxHeartRate, restingHeartRate: (_y = (_x = options.tss) === null || _x === void 0 ? void 0 : _x.overrides) === null || _y === void 0 ? void 0 : _y.restingHeartRate, refSwimSpeed: (_0 = (_z = options.tss) === null || _z === void 0 ? void 0 : _z.overrides) === null || _0 === void 0 ? void 0 : _0.refSwimSpeed, thresholdSwimSpeed: (_2 = (_1 = options.tss) === null || _1 === void 0 ? void 0 : _1.overrides) === null || _2 === void 0 ? void 0 : _2.thresholdSwimSpeed, metScore: (_4 = (_3 = options.tss) === null || _3 === void 0 ? void 0 : _3.overrides) === null || _4 === void 0 ? void 0 : _4.metScore, thresholdMet: (_6 = (_5 = options.tss) === null || _5 === void 0 ? void 0 : _5.overrides) === null || _6 === void 0 ? void 0 : _6.thresholdMet }, preserveImportedTss: (_8 = (_7 = options.tss) === null || _7 === void 0 ? void 0 : _7.preserveImportedTss) !== null && _8 !== void 0 ? _8 : true, enableHeuristicFallbacks: (_10 = (_9 = options.tss) === null || _9 === void 0 ? void 0 : _9.enableHeuristicFallbacks) !== null && _10 !== void 0 ? _10 : true }; this.maxActivityDurationDays = (_11 = options.maxActivityDurationDays) !== null && _11 !== void 0 ? _11 : 14; this.generateUnitStreams = (_12 = options.generateUnitStreams) !== null && _12 !== void 0 ? _12 : true; this.deviceInfoMode = (_13 = options.deviceInfoMode) !== null && _13 !== void 0 ? _13 : 'raw'; } } exports.ActivityParsingOptions = ActivityParsingOptions; ActivityParsingOptions.DEFAULT = new ActivityParsingOptions();