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

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.27 to 0.5.28

7

lib/Environment.js

@@ -55,2 +55,9 @@ 'use strict';

(0, _createClass3.default)(Environment, [{
key: 'init',
value: function init() {
_lodash2.default.each(this.tables, function (table) {
return table.init();
});
}
}, {
key: 'createTable',

@@ -57,0 +64,0 @@ value: function createTable(options) {

28

lib/Table.js

@@ -87,3 +87,2 @@ 'use strict';

var index = _Joi$attempt.index;
// assert.equal(_.has(schema(), pk), true, `'${pk}' is not specified in schema`);

@@ -93,2 +92,3 @@ this.tableName = tableName;

this.schema = schema;
this._schema = null;
this.relations = relations;

@@ -100,7 +100,17 @@ this._relations = null;

(0, _createClass3.default)(Table, [{
key: 'init',
value: function init() {
this._schema = this.schema();
this._relations = this.relations();
}
}, {
key: 'getSchema',
value: function getSchema() {
if (!this._schema) this.init();
return this._schema;
}
}, {
key: 'getRelations',
value: function getRelations() {
if (!this._relations) {
this._relations = this.relations();
}
if (!this._relations) this.init();
return this._relations;

@@ -111,3 +121,3 @@ }

value: function metaFields(metaKey) {
return _lodash2.default.chain(this.schema()).omitBy(function (schema) {
return _lodash2.default.chain(this.getSchema()).omitBy(function (schema) {
return !_lodash2.default.find(schema._meta, function (meta) {

@@ -123,3 +133,3 @@ return _lodash2.default.has(meta, metaKey);

return !_joi2.default.validate(data, this.schema()).error;
return !_joi2.default.validate(data, this.getSchema()).error;
}

@@ -131,3 +141,3 @@ }, {

return _joi2.default.attempt(data, this.schema());
return _joi2.default.attempt(data, this.getSchema());
}

@@ -144,3 +154,3 @@ }, {

value: function hasField(fieldName) {
return _lodash2.default.has(this.schema(), fieldName);
return _lodash2.default.has(this.getSchema(), fieldName);
}

@@ -156,3 +166,3 @@ }, {

this.assertField(fieldName);
return this.schema()[fieldName];
return this.getSchema()[fieldName];
}

@@ -159,0 +169,0 @@ }, {

{
"name": "nothinkdb",
"version": "0.5.27",
"version": "0.5.28",
"description": "Functional toolkit for rethinkdb",

@@ -51,2 +51,3 @@ "main": "lib/nothinkdb.js",

"babel-runtime": "^6.9.0",
"core-decorators": "^0.12.2",
"debug": "^2.2.0",

@@ -53,0 +54,0 @@ "joi": "^7.2.3",

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