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 0e4b257 commit 010d1e2Copy full SHA for 010d1e2
lib/cast/int32.js
@@ -1,7 +1,6 @@
1
'use strict';
2
3
const assert = require('assert');
4
-const BSON = require('bson');
5
6
/**
7
* Given a value, cast it to a Int32, or throw an `Error` if the value
@@ -21,7 +20,7 @@ module.exports = function castInt32(val) {
21
20
return null;
22
}
23
24
- const coercedVal = val instanceof BSON.Long ? val.toNumber() : Number(val);
+ const coercedVal = val._bsontype === 'Long' ? val.toNumber() : Number(val);
25
26
const INT32_MAX = 0x7FFFFFFF;
27
const INT32_MIN = -0x80000000;
0 commit comments