@alexgyver/bson 3.0.2 → 3.0.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/bson.js +4 -7
- package/package.json +1 -1
package/bson.js
CHANGED
|
@@ -37,7 +37,6 @@ const BS_CONT_CLOSE = 0 << 1;
|
|
|
37
37
|
const BS_CONT_OPEN = 1 << 1;
|
|
38
38
|
|
|
39
39
|
// subtype float
|
|
40
|
-
const BS_FLOAT_ZERO = 1;
|
|
41
40
|
const BS_FLOAT_SIZE = 4;
|
|
42
41
|
|
|
43
42
|
// subtype bin
|
|
@@ -144,12 +143,10 @@ export class BSDecoder {
|
|
|
144
143
|
case BS_BOOL:
|
|
145
144
|
return !!(header & 1);
|
|
146
145
|
|
|
147
|
-
case BS_FLOAT:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return new DataView(b.buffer, b.byteOffset, BS_FLOAT_SIZE).getFloat32(0, true);
|
|
152
|
-
}
|
|
146
|
+
case BS_FLOAT: {
|
|
147
|
+
const b = this.read(BS_FLOAT_SIZE);
|
|
148
|
+
return new DataView(b.buffer, b.byteOffset, BS_FLOAT_SIZE).getFloat32(0, true);
|
|
149
|
+
}
|
|
153
150
|
|
|
154
151
|
case BS_BIN:
|
|
155
152
|
return this.read(this.readInt(BS_GET_BIN_LEN(header))).slice();
|