Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_modifyConfig(){
if(!config.bundles && config.enviroment==="development"){
console.warn("please specify a bundles option in your enviroment config");
return;
}
let jsonStr = Ember.$("meta[name='ember-asset-map']").attr("content");
jsonStr = decodeURIComponent(jsonStr);
let jsonObj = JSON.parse(jsonStr);
let bundleMapKey = Object.keys(jsonObj);
Object.keys(config.bundles).forEach((key)=>{
if(bundleMapKey.indexOf(key) > -1){
config.bundles[key].url = jsonObj[key];
}else {
return '/assets/' + config.modulePrefix + "." + key + '.bundle.js';
}
findBundleNameByRoute: function(routeName){
//Find bundle for route
var bundleName = null;
var bundleNames = Object.keys(config.bundles);
bundleNames.forEach(function(name) {
var bundle = config.bundles[name];
if(bundle.routes.indexOf(routeName) >= 0) {
bundleName = name;
}
});
return bundleName;
},
beforeModel: function(transition, queryParams){
bundleNames.forEach(function(name) {
var bundle = config.bundles[name];
if(bundle.routes.indexOf(routeName) >= 0) {
bundleName = name;
}
});
Object.keys(config.bundles).forEach((key)=>{
if(bundleMapKey.indexOf(key) > -1){
config.bundles[key].url = jsonObj[key];
}else {
return '/assets/' + config.modulePrefix + "." + key + '.bundle.js';
}
});