mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(user-menu) add ability to ignore private methods
This commit is contained in:
parent
554023c839
commit
8961841847
3 changed files with 56 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue