Comparing version 0.3.2 to 0.4.0
@@ -31,2 +31,6 @@ var mongo = require('mongodb'); | ||
}; | ||
var shouldExtend = function(that, proto, name) { | ||
if (name[0] === '_') return false; | ||
return !that[name] && !proto.__lookupGetter__(name) && typeof proto[name] === 'function'; | ||
}; | ||
@@ -150,3 +154,3 @@ // basicly just a proxy prototype | ||
Object.keys(mongo.Collection.prototype).forEach(function(name) { // we just wanna proxy any remaining methods on collections | ||
if (!Collection.prototype[name] && typeof mongo.Collection.prototype[name] === 'function') { | ||
if (shouldExtend(Collection.prototype, mongo.Collection.prototype, name)) { | ||
Collection.prototype[name] = function() { | ||
@@ -220,3 +224,3 @@ this._exec(name, arguments); | ||
Object.keys(mongo.Db.prototype).forEach(function(name) { | ||
if (!that[name] && typeof mongo.Db.prototype[name] === 'function') { | ||
if (shouldExtend(that, mongo.Db.prototype, name)) { | ||
that[name] = function() { | ||
@@ -223,0 +227,0 @@ var args = arguments; |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["mongo", "db", "mongodb"], | ||
"version":"0.3.2", | ||
"version":"0.4.0", | ||
"homepage" : "https://github.com/gett/mongojs", | ||
@@ -14,3 +14,3 @@ "author": "Ge.tt <hello@ge.tt>", | ||
"main":"./index.js", | ||
"dependencies": {"common":">=0.1.0", "mongodb":">=0.9.6"} | ||
"dependencies": {"common":">=0.1.0", "mongodb":"1.x.x"} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8713
215
0
+ Addedabort-controller@3.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbson@0.2.22(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedkerberos@0.0.11(transitive)
+ Addedmongodb@1.4.40(transitive)
+ Addednan@1.8.4(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedreadable-stream@4.5.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removed@mongodb-js/saslprep@1.1.9(transitive)
- Removed@types/webidl-conversions@7.0.3(transitive)
- Removed@types/whatwg-url@11.0.5(transitive)
- Removedbson@6.10.0(transitive)
- Removedmemory-pager@1.5.0(transitive)
- Removedmongodb@6.11.0(transitive)
- Removedmongodb-connection-string-url@3.0.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedsparse-bitfield@3.0.3(transitive)
- Removedtr46@4.1.1(transitive)
- Removedwebidl-conversions@7.0.0(transitive)
- Removedwhatwg-url@13.0.0(transitive)
Updatedmongodb@1.x.x