Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_locateFile(path) {
path = path.replace(/\./g, '/');
if (path === 'docs/api/item') {
let { projectName } = config['ember-cli-addon-docs'];
let model = getOwner(this).lookup('route:application').modelFor('docs.api.item');
let filename = model.get('file').replace(new RegExp(`^${projectName}/`), '');
let file = addonFiles.find(f => f.match(filename));
if (file) {
return { file, inTree: 'addon' };
}
} else {
let file = appFiles
.filter(file => file.match(/\.(hbs|md)$/))
.find(file => file.match(path));
if (file) {
return { file, inTree: 'app' };
}
}
}