Socket
Socket
Sign inDemoInstall

marsdb

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marsdb - npm Package Compare versions

Comparing version 0.3.12 to 0.3.13

5

dist/Cursor.js

@@ -220,3 +220,6 @@ 'use strict';

value: function join(joinFn) {
return this.joinEach(joinFn);
(0, _invariant2['default'])(typeof joinFn === 'function', 'join(...): argument must be a function');
this.addPipeline(PIPELINE_TYPE.Join, joinFn);
return this;
}

@@ -223,0 +226,0 @@ }, {

8

lib/Cursor.js

@@ -193,3 +193,9 @@ import _each from 'lodash/collection/each';

join(joinFn) {
return this.joinEach(joinFn);
invariant(
typeof joinFn === 'function',
'join(...): argument must be a function'
);
this.addPipeline(PIPELINE_TYPE.Join, joinFn);
return this;
}

@@ -196,0 +202,0 @@

{
"name": "marsdb",
"version": "0.3.12",
"version": "0.3.13",
"author": {

@@ -5,0 +5,0 @@ "name": "Artem Artemev",

@@ -325,8 +325,29 @@ import Collection from '../../lib/Collection';

describe('#join', function () {
it('should use joinEach for an array', function () {
return db.find().join(d => {
d.should.be.an('object');
}).then((result) => {
result.should.be.an('array');
});
});
it('should use joinAll for single object', function () {
return db.findOne().join(d => {
d.should.be.an('object');
}).then((result) => {
result.should.be.an('object');
});
});
it('should throw an error if join is not a function', function () {
const cursor = new Cursor(db);
(() => cursor.join(123)).should.throw(Error);
});
});
describe('#joinEach', function () {
it('should join by function with promises', function () {
const cursor = new Cursor(db);
cursor.find().sort({b: 1}).join(d => {
cursor.find().sort({b: 1}).joinEach(d => {
const cursor2 = new Cursor(db);

@@ -346,3 +367,3 @@ return cursor2.find({g: d.g}).exec().then((result) => {

it('should not change object in a storage', function () {
return db.find().sort({b: 1}).join(d => {
return db.find().sort({b: 1}).joinEach(d => {
return db.find({g: d.g}).then((result) => {

@@ -349,0 +370,0 @@ d.groupObjs = result;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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