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

brink

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brink - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

2

package.json
{
"name": "brink",
"version": "0.5.5",
"version": "0.5.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "./src/brink/node.js",

@@ -108,2 +108,8 @@ $b(

undirty : function (recursive) {
this.forEach(function (item) {
item.undirty(recursive);
});
},
destroy : function (destroyRecords) {

@@ -110,0 +116,0 @@

@@ -454,2 +454,65 @@ /***********************************************************************

/***********************************************************************
Patches a record, recursively.
@method patch
@param {Boolean} recursive Whather you want to undirty all embedded relationships as well.
@return {Model}
************************************************************************/
patch : function (obj) {
function updateRecursively (obj2, context) {
var p;
for (p in obj2) {
if (typeof obj2[p] === 'object') {
updateRecursively(obj2[p], context[p]);
continue;
}
set(context, p, obj2[p]);
}
}
updateRecursively(obj, this);
return this;
},
/***********************************************************************
Marks all properties as clean.
@method undirty
@param {Boolean} recursive Whather you want to undirty all embedded relationships as well.
@return {Model}
************************************************************************/
undirty : function (recursive) {
var i,
p,
meta,
desc,
pMeta,
relationships;
set(this, 'dirtyAttributes.content', []);
if (!recursive) {
return this;
}
meta = this.__meta;
relationships = meta.relationships;
i = relationships.length;
while (i--) {
p = relationships[i];
desc = this.prop(p);
pMeta = desc.meta();
if (pMeta.options.embedded) {
get(this, p).undirty(true);
}
}
return this;
},
/***********************************************************************
Saves any changes to this record to the persistence layer (via the adapter).

@@ -472,4 +535,2 @@ Also adds this record to the store.

if (!isNew && !dirty.length) {return Q.resolve(this);}
set(this, 'isSaving', true);

@@ -489,3 +550,3 @@

set(self, 'dirtyAttributes.content', []);
self.undirty(true);
set(self, 'isSaving', false);

@@ -523,3 +584,3 @@ set(self, 'isLoaded', true);

if (!!override) {
set(self, 'dirtyAttributes.content', []);
self.undirty(true);
}

@@ -526,0 +587,0 @@ set(self, 'isFetching', false);

Sorry, the diff of this file is too big to display

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