fit-file-parser 2.3.2 → 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
@@ -128,7 +128,9 @@ function formatByType(data, type, scale, offset) {
128
128
  }
129
129
  }
130
130
  if (!values.includes('mask')) {
131
- return FIT.types[type][data];
131
+ const typeMap = FIT.types[type];
132
+ const mapped = typeMap[String(data)];
133
+ return mapped === undefined ? data : mapped;
132
134
  }
133
135
  const dataItem = {};
134
136
  for (const key in FIT.types[type]) {
@@ -134,7 +134,9 @@ function formatByType(data, type, scale, offset) {
134
134
  }
135
135
  }
136
136
  if (!values.includes('mask')) {
137
- 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;
138
140
  }
139
141
  const dataItem = {};
140
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.2",
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": {