Comparing version 0.3.19 to 0.3.21
@@ -61,4 +61,3 @@ // Generated by CoffeeScript 1.6.2 | ||
} | ||
model = this.field._refMapper.map(data, data); | ||
model.owner = this.owner; | ||
model = this.field._refMapper.map(this.owner, data); | ||
model.once("save", function() { | ||
@@ -65,0 +64,0 @@ return _this.push(model); |
@@ -38,5 +38,6 @@ // Generated by CoffeeScript 1.6.2 | ||
} else { | ||
refModel = this.field.root.service.model(this.field.options.ref, data); | ||
refModel = this.field.root.service.model(this.field.options.ref, data, { | ||
owner: model | ||
}); | ||
} | ||
refModel.owner = model; | ||
return refModel; | ||
@@ -43,0 +44,0 @@ }; |
@@ -50,6 +50,10 @@ // Generated by CoffeeScript 1.6.2 | ||
DataMapFieldController.prototype.prepareModel = function(model, data) { | ||
DataMapFieldController.prototype.prepareModel = function(model, data, options) { | ||
var mapper, _i, _len, _ref1, _results, | ||
_this = this; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
model.owner = options.owner; | ||
model.reset = function(data, path) { | ||
@@ -56,0 +60,0 @@ var newData; |
@@ -49,6 +49,9 @@ // Generated by CoffeeScript 1.6.2 | ||
Transporter.prototype.prepareModel = function(model, data) { | ||
Transporter.prototype.prepareModel = function(model, data, options) { | ||
var methodName, | ||
_this = this; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
if (type(data) === "string") { | ||
@@ -59,4 +62,4 @@ data = { | ||
} | ||
this._validator.prepareModel(model, data); | ||
this._dataMapper.prepareModel(model, data); | ||
this._validator.prepareModel(model, data, options); | ||
this._dataMapper.prepareModel(model, data, options); | ||
model._memos = new MemoDictionary(); | ||
@@ -63,0 +66,0 @@ model._cache = new Cache(model, data); |
// Generated by CoffeeScript 1.6.2 | ||
(function() { | ||
var EventEmitter, | ||
var Emitter, EventEmitter, | ||
__slice = [].slice; | ||
@@ -8,2 +8,74 @@ | ||
Emitter = (function() { | ||
/* | ||
*/ | ||
function Emitter() { | ||
this._listeners = {}; | ||
} | ||
/* | ||
*/ | ||
Emitter.prototype.on = function(event, callback) { | ||
if (!this._listeners[event]) { | ||
this._listeners[event] = []; | ||
} | ||
return this._listeners[event].push(callback); | ||
}; | ||
/* | ||
*/ | ||
Emitter.prototype.off = function(event, callback) { | ||
var i, listeners; | ||
if (!(listeners = this._listeners[event])) { | ||
return; | ||
} | ||
i = listeners.indexOf(callback); | ||
if (~i) { | ||
return listeners.splice(i, 1); | ||
} | ||
}; | ||
/* | ||
*/ | ||
Emitter.prototype.once = function(event, callback) { | ||
var cb, | ||
_this = this; | ||
return this.on(event, cb = function() { | ||
var args; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
_this.off(event, cb); | ||
return callback.apply(null, args); | ||
}); | ||
}; | ||
/* | ||
*/ | ||
Emitter.prototype.emit = function(event) { | ||
var fnArgs, listeners; | ||
if (!(listeners = this._listeners[event])) { | ||
return; | ||
} | ||
fnArgs = Array.prototype.slice.call(arguments, 1); | ||
for(var i = listeners.length; i--;) { | ||
listeners[i].apply(this, fnArgs); | ||
}; | ||
return void 0; | ||
}; | ||
return Emitter; | ||
})(); | ||
module.exports = function(fn, ops) { | ||
@@ -15,3 +87,3 @@ var called, em, memoizedArgs; | ||
} | ||
em = new EventEmitter(); | ||
em = new Emitter(); | ||
called = false; | ||
@@ -49,3 +121,3 @@ memoizedArgs = null; | ||
} | ||
}), 0); | ||
}), 1); | ||
}); | ||
@@ -52,0 +124,0 @@ fn.apply(this, args); |
{ | ||
"name": "linen", | ||
"version": "0.3.19", | ||
"version": "0.3.21", | ||
"description": "Linen (line-in) maps API's to [bindable](/classdojo/bindable.js) `objects`, and `collections`. At [classdojo](http://classdojo.com), we use `linen` to abstract our API from front-end, so we don't necessarily depend on any sort of API while developing new components. This allows us to rapidly build prototypes which can be wired up later.", | ||
@@ -24,3 +24,14 @@ "main": "./lib/index.js", | ||
"mocha": "~1.12.0", | ||
"benchmark": "~1.0.0" | ||
"benchmark": "~1.0.0", | ||
"browserify": "~2.26.0", | ||
"karma-script-launcher": "~0.1.0", | ||
"karma-chrome-launcher": "~0.1.0", | ||
"karma-firefox-launcher": "~0.1.0", | ||
"karma-html2js-preprocessor": "~0.1.0", | ||
"karma-jasmine": "~0.1.0", | ||
"karma-requirejs": "~0.1.0", | ||
"karma-coffee-preprocessor": "~0.1.0", | ||
"karma-phantomjs-launcher": "~0.1.0", | ||
"karma": "~0.10.0", | ||
"karma-mocha": "~0.1.0" | ||
}, | ||
@@ -27,0 +38,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8102271
140
243070
14
106
58