Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Check if the same fixture was previously added, if so, we remove it
// from our array of fixture overwrites.
var index = find(settings, !! fixture);
if (index > -1) {
overwrites.splice(index, 1);
}
if (fixture == null) {
return;
}
settings.fixture = fixture;
overwrites.push(settings);
// If a fixture isn't provided, we assume that settings is
// an array of fixtures, and we should iterate over it, and set up
// the new fixtures.
} else {
helpers.each(settings, function (fixture, url) {
$fixture(url, fixture);
});
}
};
var replacer = /\{([^\}]+)\}/g;
* }
* ```
*
* Set `parseInstanceProp` to `"todo"` like:
*
* ```
* can.connect(["data-parse","data-url"],{
* url : "/todos",
* parseInstanceProp: "todo"
* });
* ```
*/
};
helpers.each(pairs, function(parseFunction, name){
behavior[name] = function(params){
var self = this;
return baseConnect[name].call(this, params).then(function(){
return self[parseFunction].apply(self, arguments);
});
};
});
return behavior;
});