int64-native
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -1,4 +0,3 @@ | ||
var path = require('path'); | ||
var nativeModule = require('bindings')('Int64.node'); | ||
var modulePath = path.join(__dirname, 'build', 'Release', 'Int64'); | ||
module.exports = require(modulePath).Int64; | ||
module.exports = nativeModule.Int64; |
{ | ||
"name": "int64-native", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "A simple uint64_t wrapper for JavaScript", | ||
@@ -26,3 +26,7 @@ "keywords": [ | ||
"license": "MIT", | ||
"readmeFilename": "README.md" | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"bindings": "1.2.x", | ||
"nan": "^2.0.8" | ||
} | ||
} |
@@ -111,2 +111,16 @@ var Int64 = require('../int64'), | ||
}); | ||
it('can be extended via prototype', function testExtendPrototype() { | ||
Int64.prototype.multiply = function(other) { | ||
// NOTE: this will suffer from the same integer truncation issues that | ||
// you get normally when manipulating JavaScript numbers. | ||
var a = this.toNumber(), | ||
b = other.toNumber(); | ||
return new Int64(a * b); | ||
}; | ||
var a = new Int64(2), | ||
b = new Int64(3), | ||
c = new Int64(6); | ||
expect(a.multiply(b).equals(c)).to.be.true; | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
112
1
22150
2
+ Addedbindings@1.2.x
+ Addednan@^2.0.8
+ Addedbindings@1.2.1(transitive)
+ Addednan@2.22.0(transitive)