mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Merge pull request #3911 from captbaritone/nested-ternary
Avoid nested ternary
This commit is contained in:
@@ -822,10 +822,12 @@
|
||||
if (models == null) return;
|
||||
|
||||
options = _.defaults({}, options, setOptions);
|
||||
if (options.parse && !this._isModel(models)) models = this.parse(models, options);
|
||||
if (options.parse && !this._isModel(models)) {
|
||||
models = this.parse(models, options) || [];
|
||||
}
|
||||
|
||||
var singular = !_.isArray(models);
|
||||
models = singular ? (models ? [models] : []) : models.slice();
|
||||
models = singular ? [models] : models.slice();
|
||||
|
||||
var at = options.at;
|
||||
if (at != null) at = +at;
|
||||
|
||||
Reference in New Issue
Block a user