element-book
Version:
An [`element-vir`](https://npmjs.com/package/element-vir) drop-in element for building, testing, and demonstrating a collection of elements (or, in other words, a design system).
34 lines (33 loc) • 742 B
JavaScript
/**
* Top level routes supported by the element-book app.
*
* @category Internal
*/
export var BookMainRoute;
(function (BookMainRoute) {
BookMainRoute["Search"] = "search";
BookMainRoute["Book"] = "book";
})(BookMainRoute || (BookMainRoute = {}));
/**
* Extract the current search query from the current route paths.
*
* @category Internal
*/
export function extractSearchQuery(paths) {
if (paths[0] === BookMainRoute.Book) {
return '';
}
else {
return paths[1] ? decodeURIComponent(paths[1]) : '';
}
}
/**
* The default element-book app route.
*
* @category Internal
*/
export const defaultBookFullRoute = {
hash: undefined,
paths: [BookMainRoute.Book],
search: undefined,
};