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

dialect

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dialect - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.npmignore

37

lib/stores/mongodb.js

@@ -58,2 +58,19 @@ var DB = require('mongodb').Db,

function collectionSetup() {
STORE.db.collection(options.collection || 'translations', function (err, collection) {
if (collection) {
collection.ensureIndex(
{original: 1, locale: 1, translation: 1},
{unique: true},
function (err) {
connect(err, collection);
});
} else {
STORE.db.createCollection(options.collection || 'translations', function (err, collection) {
connect(err, collection);
});
}
});
}
if (!_is_connected) {

@@ -64,11 +81,13 @@ STORE.db.open(function (err, db) {

} else {
STORE.db.collection(options.collection || 'translations', function (err, collection) {
if (collection) {
connect(err, collection);
} else {
STORE.db.createCollection(options.collection || 'translations', function (err, collection) {
connect(err, collection);
});
}
});
if (options.username && options.password) {
db.authenticate(options.username, options.password, function (err) {
if (err) {
callback(err, null);
} else {
collectionSetup();
}
});
} else {
collectionSetup();
}
}

@@ -75,0 +94,0 @@ });

{
"name": "dialect",
"description": "Translations manager for nodejs",
"version": "1.0.3",
"version": "1.0.4",
"author": "Pau Ramon <masylum@gmail.com>",

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

@@ -54,2 +54,4 @@ ,, ,, ,,

* `collection`: _translations_
* `username` (optional)
* `password` (optional)
* `sqlite`

@@ -56,0 +58,0 @@ * `database`: _dialect.db_

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