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

roots-db

Package Overview
Dependencies
Maintainers
1
Versions
383
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roots-db - npm Package Compare versions

Comparing version 0.41.5 to 0.41.6

lib/CountersCollection.js

11

lib/mongodb.driver.js

@@ -93,2 +93,3 @@ /*

this.findEach = this.commonGateway( 'findEach' ) ;
this.getNextCounterFor = this.commonGateway( 'getNextCounterFor' ) ;

@@ -532,2 +533,12 @@ this.clear = this.commonGateway( 'clear' ) ;

// Get and increment a counter
MongoDriver.getNextCounterFor = async function( name ) {
var result = await this.mongoCollection.findOneAndUpdate( { name } , { $inc: { counter: 1 } } , { upsert: true } ) ;
// It returns the value before incrementation, so we have to add 1
return result ? result.counter + 1 : 1 ;
} ;
// Collection-wide

@@ -534,0 +545,0 @@

1

lib/rootsDb.js

@@ -134,2 +134,3 @@ /*

rootsDb.VersionCollection = require( './VersionCollection.js' ) ;
rootsDb.CountersCollection = require( './CountersCollection.js' ) ;

@@ -136,0 +137,0 @@ rootsDb.Import = require( './Import.js' ) ;

@@ -52,2 +52,5 @@ /*

this.collections = {} ;
this.versionCollection = null ;
this.countersCollection = null ;
}

@@ -98,2 +101,21 @@

World.prototype.createCountersCollection = function( name , schema ) {
if ( this.countersCollection ) {
throw new Error( 'Counters collection already created' ) ;
}
this.countersCollection = this.collections[ name ] = new rootsDb.CountersCollection( this , name , schema ) ;
return this.countersCollection ;
} ;
World.prototype.createAndInitCountersCollection = async function( name , schema ) {
var collection = this.createCountersCollection( name , schema ) ;
await collection.init() ;
return collection ;
} ;
World.prototype.createMemoryModel = function( options ) {

@@ -100,0 +122,0 @@ return new rootsDb.MemoryModel( this , options ) ;

2

package.json
{
"name": "roots-db",
"version": "0.41.5",
"version": "0.41.6",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=16.20.1"

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