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 +3 -2
- package/dist/cjs/binary.js +3 -2
- package/package.json +1 -1
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
|
-
|
|
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]) {
|
package/dist/cjs/binary.js
CHANGED
|
@@ -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
|
-
|
|
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]) {
|