New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

Backbone.Mutators

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Backbone.Mutators - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

49

backbone.mutators.js

@@ -1,30 +0,5 @@

/*! Backbone.Mutators - v0.4.0
------------------------------
Build @ 2013-05-01
Documentation and Full License Available at:
http://asciidisco.github.com/Backbone.Mutators/index.html
git://github.com/asciidisco/Backbone.Mutators.git
Copyright (c) 2013 Sebastian Golasch <public@asciidisco.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.*/
(function (root, factory, undef) {
'use strict';
if (typeof exports === 'object') {
if (typeof exports === 'object' && typeof require === 'function') {
// Node. Does not work with strict CommonJS, but

@@ -124,2 +99,4 @@ // only CommonJS-like enviroments that support module.exports,

ret = oldSet.call(this, key, value, options);
// seamleassly stolen from backbone core

@@ -147,6 +124,5 @@ // check if the setter action is triggered

if (_.isObject(attrs)) {
if (isMutator === true && _.isObject(attrs)) {
_.each(attrs, _.bind(function (attr, attrKey) {
var cur_ret = null;
if (isMutator === true && _.isObject(this.mutators[attrKey]) === true) {
if (_.isObject(this.mutators[attrKey]) === true) {
// check if we need to set a single value

@@ -163,21 +139,10 @@

}
cur_ret = meth.call(this, attrKey, attr, options, _.bind(oldSet, this));
meth.call(this, attrKey, attr, options, _.bind(oldSet, this));
}
}
if (cur_ret === null) {
cur_ret = _.bind(oldSet, this)(attrKey, attr, options);
}
if (ret !== false) { ret = cur_ret; }
}, this));
}
//validation purposes
if (ret !== null) {
return ret;
}
return oldSet.call(this, key, value, options);
return ret;
};

@@ -184,0 +149,0 @@

2

component.json
{
"name": "Backbone.Mutators",
"version": "0.4.0",
"version": "0.4.1",
"main": "backbone.mutators.js",

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

{
"name": "Backbone.Mutators",
"version": "0.4.0",
"version": "0.4.1",
"description": "Backbone plugin to override getters and setters with logic",

@@ -5,0 +5,0 @@ "homepage": "http://asciidisco.github.com/Backbone.Mutators/index.html",

@@ -323,2 +323,6 @@ ## Backbone.Mutators

### 0.4.1
+ Fixes [#22](https://github.com/asciidisco/Backbone.Mutators/pull/22)
+ Fixes [#24](https://github.com/asciidisco/Backbone.Mutators/pull/24)
### 0.3.1

@@ -328,2 +332,6 @@ + Change get context to modal instead of attributes

### 0.3.1
+ Change get context to modal instead of attributes
+ Added single getter / setter method
### 0.3.0

@@ -330,0 +338,0 @@ + Removed the Cake based build process and moved to grunt

@@ -99,2 +99,4 @@ (function (root, factory, undef) {

ret = oldSet.call(this, key, value, options);
// seamleassly stolen from backbone core

@@ -122,6 +124,5 @@ // check if the setter action is triggered

if (_.isObject(attrs)) {
if (isMutator === true && _.isObject(attrs)) {
_.each(attrs, _.bind(function (attr, attrKey) {
var cur_ret = null;
if (isMutator === true && _.isObject(this.mutators[attrKey]) === true) {
if (_.isObject(this.mutators[attrKey]) === true) {
// check if we need to set a single value

@@ -138,21 +139,10 @@

}
cur_ret = meth.call(this, attrKey, attr, options, _.bind(oldSet, this));
meth.call(this, attrKey, attr, options, _.bind(oldSet, this));
}
}
if (cur_ret === null) {
cur_ret = _.bind(oldSet, this)(attrKey, attr, options);
}
if (ret !== false) { ret = cur_ret; }
}, this));
}
//validation purposes
if (ret !== null) {
return ret;
}
return oldSet.call(this, key, value, options);
return ret;
};

@@ -159,0 +149,0 @@

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