mmenu-js
Version:
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
32 lines (26 loc) • 622 B
text/typescript
/**
* Extend shorthand options.
*
* @param {object} options The options to extend.
* @return {object} The extended options.
*/
export function extendShorthandOptions(
options: mmOptionsNavbarsNavbar
): mmOptionsNavbarsNavbar {
if (typeof options == 'boolean' && options) {
options = {};
}
if (typeof options != 'object') {
options = {};
}
if (typeof options.content == 'undefined') {
options.content = ['prev', 'title'];
}
if (!(options.content instanceof Array)) {
options.content = [options.content];
}
if (typeof options.use == 'undefined') {
options.use = true;
}
return options;
};