Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working on Node Support #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 17 additions & 3 deletions backbone-nested.js
Expand Up @@ -6,10 +6,18 @@
* Copyright (c) 2011-2012 Aidan Feldman
* MIT Licensed (LICENSE)
*/
/*global $, _, Backbone */
/*global require, module, $, _, Backbone */
(function(){
'use strict';

var $ = this.$;
var _ = (typeof require === "function" ? require('underscore') : void 0) || this._;
var Backbone = (typeof require === "function" ? require('backbone') : void 0) || this.Backbone;
var deepExtendPlainObjects = (typeof require === "function" ? require('bal-util').deepExtendPlainObjects : void 0) || function(){
var args = Array.prototype.slice.call(arguments);
args.unshift(true);
return $.extend.apply($,args);
};
var _delayedTriggers = [];

Backbone.NestedModel = Backbone.Model.extend({
Expand Down Expand Up @@ -296,7 +304,7 @@
},

deepClone: function(obj){
return $.extend(true, {}, obj);
return deepExtendPlainObjects({}, obj);
},

walkPath: function(obj, attrPath, callback, scope){
Expand All @@ -315,4 +323,10 @@

});

}());

// Node Export
if ( module && module.exports ) {
module.exports = Backbone;
}

}).call(this);
21 changes: 17 additions & 4 deletions package.json
@@ -1,9 +1,13 @@
{
"name": "backbone-nested",
"version": "1.1.2",
"version": "1.1.3",
"description": "A plugin to make Backbone.js keep track of nested attributes.",
"dependencies": {
"backbone": "0.9.x"
"bal-util": "~1.16.1"
},
"peerDependencies": {
"underscore": "~1.4.4",
"backbone": "0.9.2"
},
"devDependencies": {
"grunt": "0.3.x"
Expand All @@ -12,9 +16,18 @@
"main": "backbone-nested.js",
"repositories": [
{
"type": "git",
"type": "git",
"url": "https://github.com/afeld/backbone-nested.git"
}
],
"github": "https://github.com/afeld/backbone-nested"
"github": "https://github.com/afeld/backbone-nested",
"author": "Aidan Feldman <aidan.feldman@gmail.com> (https://github.com/afeld)",
"maintainers": [
"Aidan Feldman <aidan.feldman@gmail.com> (https://github.com/afeld)",
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
],
"contributors": [
"Aidan Feldman <aidan.feldman@gmail.com> (https://github.com/afeld)",
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
]
}