fit-file-parser 2.3.1 → 2.3.3

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/binary.js CHANGED
@@ -5,7 +5,6 @@ const CompressedLocalMsgNumMask = 0x60;
5
5
  const CompressedHeaderMask = 0x80;
6
6
  const GarminTimeOffset = 631065600000;
7
7
  let monitoring_timestamp = 0;
8
- console.log(">>> LOADING BINARY.TS <<<");
9
8
  export function addEndian(littleEndian, bytes) {
10
9
  let result = 0;
11
10
  if (!littleEndian)
@@ -129,7 +128,9 @@ function formatByType(data, type, scale, offset) {
129
128
  }
130
129
  }
131
130
  if (!values.includes('mask')) {
132
- return FIT.types[type][data];
131
+ const typeMap = FIT.types[type];
132
+ const mapped = typeMap[String(data)];
133
+ return mapped === undefined ? data : mapped;
133
134
  }
134
135
  const dataItem = {};
135
136
  for (const key in FIT.types[type]) {
@@ -11,7 +11,6 @@ const CompressedLocalMsgNumMask = 0x60;
11
11
  const CompressedHeaderMask = 0x80;
12
12
  const GarminTimeOffset = 631065600000;
13
13
  let monitoring_timestamp = 0;
14
- console.log(">>> LOADING BINARY.TS <<<");
15
14
  function addEndian(littleEndian, bytes) {
16
15
  let result = 0;
17
16
  if (!littleEndian)
@@ -135,7 +134,9 @@ function formatByType(data, type, scale, offset) {
135
134
  }
136
135
  }
137
136
  if (!values.includes('mask')) {
138
- return fit_js_1.FIT.types[type][data];
137
+ const typeMap = fit_js_1.FIT.types[type];
138
+ const mapped = typeMap[String(data)];
139
+ return mapped === undefined ? data : mapped;
139
140
  }
140
141
  const dataItem = {};
141
142
  for (const key in fit_js_1.FIT.types[type]) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fit-file-parser",
3
3
  "type": "module",
4
- "version": "2.3.1",
4
+ "version": "2.3.3",
5
5
  "private": false,
6
6
  "description": "Parse your .FIT files easily, directly from JS (Garmin, Polar, Suunto)",
7
7
  "author": {