Socket
Socket
Sign inDemoInstall

nothinkdb

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nothinkdb - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

30

lib/Table.js

@@ -62,3 +62,4 @@ /* eslint no-shadow: 0, no-param-reassign: 0 */

};
}, 'relation')
}, 'relation'),
index: _joi2['default'].object()['default']({}, 'index')
});

@@ -70,2 +71,3 @@

var relations = _Joi$attempt.relations;
var index = _Joi$attempt.index;

@@ -78,2 +80,3 @@ // assert.equal(_.has(schema(), pk), true, `'${pk}' is not specified in schema`);

this.relations = relations;
this.index = index;
}

@@ -207,15 +210,14 @@

indexFields = [].concat(_toConsumableArray(this.metaFields('index')), _toConsumableArray(this.metaFields('unique')));
context$2$0.next = 3;
return regeneratorRuntime.awrap(indexFields.reduce(function (promise, indexName) {
return promise.then(function () {
return _this.ensureIndex(connection, indexName);
});
}, Promise.resolve()));
if (!_lodash2['default'].isEmpty(indexFields)) {
context$2$0.next = 3;
break;
}
return context$2$0.abrupt('return');
case 3:
context$2$0.next = 5;
return regeneratorRuntime.awrap(indexFields.reduce(function (promise, key) {
return regeneratorRuntime.awrap(_lodash2['default'].reduce(this.index, function (promise, option, indexName) {
return promise.then(function () {
return _this.ensureIndex(connection, key);
return option === true ? _this.ensureIndex(connection, indexName) : _this.ensureIndex(connection, indexName, option);
});

@@ -232,7 +234,7 @@ }, Promise.resolve()));

key: 'ensureIndex',
value: function ensureIndex(connection, field) {
value: function ensureIndex(connection, indexName, option) {
return regeneratorRuntime.async(function ensureIndex$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
if (!(this.pk === field)) {
if (!(this.pk === indexName)) {
context$2$0.next = 2;

@@ -246,7 +248,7 @@ break;

context$2$0.next = 4;
return regeneratorRuntime.awrap(_rethinkdb2['default'].branch(this.query().indexList().contains(field).not(), this.query().indexCreate(field), null).run(connection));
return regeneratorRuntime.awrap(_rethinkdb2['default'].branch(this.query().indexList().contains(indexName).not(), this.query().indexCreate(indexName, option), null).run(connection));
case 4:
context$2$0.next = 6;
return regeneratorRuntime.awrap(this.query().indexWait(field).run(connection));
return regeneratorRuntime.awrap(this.query().indexWait(indexName).run(connection));

@@ -253,0 +255,0 @@ case 6:

{
"name": "nothinkdb",
"version": "0.5.9",
"version": "0.5.10",
"description": "Functional toolkit for rethinkdb",

@@ -5,0 +5,0 @@ "main": "lib/nothinkdb.js",

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