Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongojs-hooks

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongojs-hooks - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

14

mongojs-hooks.js

@@ -87,3 +87,3 @@ var mongojs = require("mongojs");

// Recurse
if (newObject[sKey] instanceof Object)
if (isObject(newObject[sKey]))
newObject[sKey] = this.sanitise(newObject[sKey]);

@@ -116,3 +116,3 @@ }.bind(this));

// Recurse
if (newObject[key] instanceof Object)
if (isObject(newObject[key]))
newObject[key] = this.unsanitise(newObject[key]);

@@ -125,2 +125,12 @@ }.bind(this));

var isObject = function (obj) {
if (typeof obj !== "object" || obj === null)
return false;
var ObjProto = obj;
while (Object.getPrototypeOf(ObjProto = Object.getPrototypeOf(ObjProto)) !== null) ;
return Object.getPrototypeOf(obj) === ObjProto;
};
module.exports = mongojs;

2

package.json
{
"name": "mongojs-hooks",
"description": "Wrap monogjs in pre and post hooks",
"version": "0.1.6",
"version": "0.1.7",
"main": "./mongojs-hooks",

@@ -6,0 +6,0 @@ "author": {

@@ -125,2 +125,12 @@ var mongo = require("../mongojs-hooks");

});
describe("when includes a Date", function () {
it("should not alter date", function () {
var date = new Date("2015-03-02");
var sanitised = mongo.util.sanitise({ date: date });
(sanitised.date instanceof Date).should.be.true;
sanitised.date.should.deep.equal(new Date("2015-03-02"));
});
});
});

@@ -249,3 +259,13 @@

});
describe("when includes a Date", function () {
it("should not alter date", function () {
var date = new Date("2015-03-02");
var unsanitised = mongo.util.unsanitise({ date: date });
(unsanitised.date instanceof Date).should.be.true;
unsanitised.date.should.deep.equal(new Date("2015-03-02"));
});
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc