Socket
Socket
Sign inDemoInstall

iridium

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iridium - npm Package Compare versions

Comparing version 2.11.3 to 2.11.4

4

lib/Model.js

@@ -258,4 +258,6 @@ var _ = require('lodash'),

var cacheDoc = _.cloneDeep(target);
var wrapped = target;
var wrapped = options.wrap ? wrapper(target, false, options.partial) : this.fromSource(target);
if(options.wrap) wrapped = wrapper(target, false, options.partial);
else this.fromSource(wrapped);

@@ -262,0 +264,0 @@ doHook(this.options.hooks.ready, wrapped, (function(err) {

{
"name": "iridium",
"version": "2.11.3",
"version": "2.11.4",
"author": "Benjamin Pannell <admin@sierrasoftworks.com>",

@@ -5,0 +5,0 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users",

@@ -111,2 +111,33 @@ var config = require('./config.js');

describe('with wrap:false', function() {
before(function(done) {
model = new Model(db, 'model', {
name: /.+/
}, {
});
model.remove(function(err) {
if(err) return done(err);
model.create({
name: 'Demo1'
}, function(err, instance) {
if(err) return done(err);
return done();
});
});
});
it('should return the raw document', function(done) {
model.findOne({ name: 'Demo1' }, { wrap: false }, function(err, doc) {
should.not.exist(err);
should.exist(doc);
doc.should.have.ownProperty('id');
doc.should.have.ownProperty('name').and.eql('Demo1');
done();
});
});
});
describe('with partial results', function() {

@@ -152,2 +183,12 @@ before(function(done) {

});
it('should work with wrap: false', function(done) {
model.findOne({ name: 'Demo1' }, { wrap: false, fields: { id: 1, name: 1 }}, function(err, doc) {
if(err) return done(err);
should.exist(doc);
doc.should.have.ownProperty('name').and.eql('Demo1');
doc.should.not.have.ownProperty('description');
done();
});
});
});

@@ -154,0 +195,0 @@ });

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