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

backbone-relations

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-relations - npm Package Compare versions

Comparing version 0.4.6 to 0.4.7

backbone-relations.sublime-project

11

backbone-relations.js

@@ -36,7 +36,10 @@ (function () {

if (!this.via) return this.get();
var models = this.owner.resolve(this.via).pluck(this.viaKey);
var via = this.owner.relations[this.via];
var method = via.hasOne ? 'get' : 'pluck';
var resolved = this.owner.resolve(this.via)[method](this.viaKey);
if (this.hasOne) return resolved;
return new this.hasMany(
models[0] instanceof this.hasMany ?
_.flatten(_.pluck(models, 'models')) :
models
resolved[0] instanceof this.hasMany ?
_.flatten(_.pluck(resolved, 'models')) :
resolved
);

@@ -43,0 +46,0 @@ }

{
"name": "backbone-relations",
"version": "0.4.6",
"version": "0.4.7",
"main": "./backbone-relations.js",

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

{
"name": "backbone-relations",
"version": "0.4.6",
"version": "0.4.7",
"author": "Casey Foster <c@sey.me>",

@@ -5,0 +5,0 @@ "licence": "MIT",

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