Skip to content

Commit 010d1e2

Browse files
misc change
1 parent 0e4b257 commit 010d1e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/cast/int32.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const BSON = require('bson');
54

65
/**
76
* Given a value, cast it to a Int32, or throw an `Error` if the value
@@ -21,7 +20,7 @@ module.exports = function castInt32(val) {
2120
return null;
2221
}
2322

24-
const coercedVal = val instanceof BSON.Long ? val.toNumber() : Number(val);
23+
const coercedVal = val._bsontype === 'Long' ? val.toNumber() : Number(val);
2524

2625
const INT32_MAX = 0x7FFFFFFF;
2726
const INT32_MIN = -0x80000000;

0 commit comments

Comments
 (0)