We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f78bf1 commit 9dcada3Copy full SHA for 9dcada3
lib/cast/int32.js
@@ -1,5 +1,6 @@
1
'use strict';
2
3
+const isBsonType = require('../helpers/isBsonType');
4
const assert = require('assert');
5
6
/**
@@ -20,7 +21,7 @@ module.exports = function castInt32(val) {
20
21
return null;
22
}
23
- const coercedVal = val._bsontype === 'Long' ? val.toNumber() : Number(val);
24
+ const coercedVal = isBsonType(val, 'Long') ? val.toNumber() : Number(val);
25
26
const INT32_MAX = 0x7FFFFFFF;
27
const INT32_MIN = -0x80000000;
0 commit comments