Return early from function
This commit is contained in:
parent
3a8948f0cd
commit
c8b4d2de21
|
@ -8,11 +8,10 @@ export default function (chrome, internals) {
|
|||
|
||||
chrome.getNavLinkById = (id) => {
|
||||
const navLink = internals.nav.find(link => link.id === id);
|
||||
if (navLink) {
|
||||
return navLink;
|
||||
} else {
|
||||
if (!navLink) {
|
||||
throw new Error(`Nav link for id = ${id} not found`);
|
||||
}
|
||||
return navLink;
|
||||
};
|
||||
|
||||
chrome.getBasePath = function () {
|
||||
|
|
Loading…
Reference in a new issue