@stories-js/core
Version:
Stories web components to build stories
14 lines • 361 B
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
export function ensurePanel(panels, selectedPanel, currentPanel) {
const keys = Object.keys(panels);
if (selectedPanel && keys.indexOf(selectedPanel) >= 0) {
return selectedPanel;
}
if (keys.length) {
return keys[0];
}
return currentPanel;
}
//# sourceMappingURL=panels.js.map