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

thinky

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thinky - npm Package Compare versions

Comparing version 1.16.10 to 1.16.11

25

lib/document.js

@@ -1720,3 +1720,28 @@ var schemaUtil = require(__dirname+'/schema.js');

/**
* Have the model emit 'retrieved' with the current document and
* recurse to have all joined models do the same.
*/
Document.prototype._emitRetrieve = function() {
var self = this;
self.getModel().emit('retrieved', self);
util.loopKeys(self._getModel()._joins, function(joins, key) {
var join = joins[key];
if ((joins[key].type === 'hasOne') || (joins[key].type === 'belongsTo')) {
if ((self[key] != null) && (typeof self[key]._emitRetrieve === 'function')) {
self[key]._emitRetrieve();
}
}
else if ((joins[key].type === 'hasMany') || (joins[key].type === 'hasAndBelongsToMany')) {
if (Array.isArray(self[key])) {
for(var i=0; i<self[key].length; i++) {
if (typeof self[key][i]._emitRetrieve === 'function') {
self[key][i]._emitRetrieve();
}
}
}
}
})
}
module.exports = Document;

6

lib/model.js

@@ -1140,3 +1140,3 @@ var util = require(__dirname+'/util.js');

self.emit('retrieved', newDoc);
newDoc._emitRetrieve();

@@ -1178,3 +1178,3 @@ promise = util.hook({

self.emit('retrieved', newDoc);
newDoc._emitRetrieve();

@@ -1229,3 +1229,3 @@ promise = util.hook({

self.emit('retrieved', newDoc);
newDoc._emitRetrieve();

@@ -1232,0 +1232,0 @@ promise = util.hook({

@@ -201,2 +201,3 @@ var arrayPrefix = "__array"

|| type.isArray(schema)
|| type.isAny(schema)
|| type.isVirtual(schema)){ // Unknown type

@@ -203,0 +204,0 @@ // Nothing to do here

@@ -212,2 +212,12 @@ var schema = require(__dirname+'/../schema.js');

/**
* Check if the first argument is a TypeAny object or not
* @param {Object} obj The object to check against TypeAny.
* @return {boolean}
*/
Type.prototype.isAny = function(obj) {
return obj instanceof TypeAny;
}
module.exports = new Type();
{
"name": "thinky",
"version": "1.16.10",
"version": "1.16.11",
"description": "RethinkDB ORM for Node.js",

@@ -5,0 +5,0 @@ "main": "lib/thinky.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