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

mongot

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongot - npm Package Compare versions

Comparing version 0.2.12 to 0.2.13

5

build/collection.spec.js

@@ -146,6 +146,11 @@ "use strict";

yield setupMany(collection, documents);
const findOneAndUpdateUndefinedResult = yield collection.findOneAndUpdate({ undefinedKey: 'unknown' }, { $set: { name: 'foo2' } });
const findOneAndUpdateResult = yield collection.findOneAndUpdate(documents[0], { $set: { name: 'foo2' } });
const findOneAndReplaceResult = yield collection.findOneAndReplace(documents[1], Object.assign({}, documents[1], { name: 'bar1' }), { returnOriginal: false });
const findOneAndDeleteResult = yield collection.findOneAndDelete(documents[2]);
t.equal(findOneAndUpdateUndefinedResult.has(), false, 'findOneAndUpdateUndefinedResult.has() should return false');
t.equal(findOneAndUpdateUndefinedResult.get(), null, 'findOneAndUpdateUndefinedResult.get() should return null');
t.equal(findOneAndUpdateResult.has(), true, 'findOneAndUpdateResult.has() should return true');
t.same(findOneAndUpdateResult.get().name, 'foo', 'findOneAndUpdateResult should contain an original document');
t.equal(findOneAndReplaceResult.has(), true, 'findOneAndReplaceResult.has() should return true');
t.same(findOneAndReplaceResult.get().name, 'bar1', 'findOneAndReplaceResult should contain a replaced document');

@@ -152,0 +157,0 @@ t.same(findOneAndDeleteResult.get().toObject(), documents[2].toObject(), 'findOneAndDeleteResult should contain a deleted document');

5

build/collection/helpers.js

@@ -29,4 +29,7 @@ "use strict";

constructor({ lastErrorObject, factory, value }) {
this.ref = null;
this.lastError = lastErrorObject;
this.ref = value ? factory(value) : null;
if (!!value) {
this.ref = factory(value);
}
}

@@ -33,0 +36,0 @@ has() {

2

package.json
{
"name": "mongot",
"version": "0.2.12",
"version": "0.2.13",
"description": "A lightweight typed MongoDb library for TypeScript.",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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