feature(user-menu) add ability to ignore private methods

This commit is contained in:
coderaiser 2019-05-28 19:04:22 +03:00
parent 554023c839
commit 8961841847
3 changed files with 56 additions and 1 deletions

View file

@ -36,6 +36,7 @@ module.exports.hide = hide;
const getKey = (a) => a.split(' - ')[0];
const beginWith = (a) => (b) => a === getKey(b);
const notPrivate = ([a]) => a !== '_';
const {CurrentInfo} = DOM;
@ -49,7 +50,9 @@ async function show() {
if (error)
return Dialog.alert(`User menu error: ${error.message}`);
const options = Object.keys(userMenu);
const options = Object
.keys(userMenu)
.filter(notPrivate);
const button = createElement('button', {
className: 'cloudcmd-user-menu-button',