@swimedge/metrics 1.1.1 → 1.1.2
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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -37,7 +37,9 @@ const formatTime = (seconds) => {
|
|
|
37
37
|
if (mins >= 60) {
|
|
38
38
|
const hours = Math.floor(mins / 60);
|
|
39
39
|
const remainingMins = mins % 60;
|
|
40
|
-
return `${hours}:${remainingMins.toString().padStart(2, '0')}:${secs
|
|
40
|
+
return `${hours}:${remainingMins.toString().padStart(2, '0')}:${secs
|
|
41
|
+
.toString()
|
|
42
|
+
.padStart(2, '0')}`;
|
|
41
43
|
}
|
|
42
44
|
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
43
45
|
};
|
|
@@ -353,7 +355,7 @@ exports.METRICS_REGISTRY = {
|
|
|
353
355
|
key: 'calories',
|
|
354
356
|
label: 'Calories',
|
|
355
357
|
unit: 'kcal',
|
|
356
|
-
category: MetricCategory.
|
|
358
|
+
category: MetricCategory.HEALTH,
|
|
357
359
|
description: 'Total calories burned during the swimming session.',
|
|
358
360
|
icon: 'flame-outline',
|
|
359
361
|
isPerSession: true,
|
|
@@ -363,7 +365,7 @@ exports.METRICS_REGISTRY = {
|
|
|
363
365
|
availableFrom: { watch: true, manual: true },
|
|
364
366
|
swimTypes: [SwimType.INDOOR, SwimType.OPEN_WATER],
|
|
365
367
|
hasChart: true,
|
|
366
|
-
formatter: (s) =>
|
|
368
|
+
formatter: (s) => s.calories,
|
|
367
369
|
condition: (s) => !!s.calories,
|
|
368
370
|
},
|
|
369
371
|
totalStrokeCount: {
|
|
@@ -524,9 +526,11 @@ exports.METRICS_REGISTRY = {
|
|
|
524
526
|
2: 'Easy',
|
|
525
527
|
3: 'Moderate',
|
|
526
528
|
4: 'Hard',
|
|
527
|
-
5: 'Very Hard'
|
|
529
|
+
5: 'Very Hard',
|
|
528
530
|
};
|
|
529
|
-
const effortNum = typeof s.perceivedEffort === 'string'
|
|
531
|
+
const effortNum = typeof s.perceivedEffort === 'string'
|
|
532
|
+
? parseInt(s.perceivedEffort)
|
|
533
|
+
: s.perceivedEffort;
|
|
530
534
|
return effortMap[effortNum] || 'Unknown';
|
|
531
535
|
},
|
|
532
536
|
condition: (s) => !!s.perceivedEffort,
|