chore: update to standard 12
This commit is contained in:
parent
9e85bdb02c
commit
558fff69e7
198 changed files with 4455 additions and 2940 deletions
|
@ -1,12 +1,12 @@
|
|||
'use strict'
|
||||
|
||||
const {TopLevelWindow, MenuItem, webContents} = require('electron')
|
||||
const {sortMenuItems} = require('./menu-utils')
|
||||
const { TopLevelWindow, MenuItem, webContents } = require('electron')
|
||||
const { sortMenuItems } = require('./menu-utils')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const bindings = process.atomBinding('menu')
|
||||
|
||||
const {Menu} = bindings
|
||||
const { Menu } = bindings
|
||||
let applicationMenu = null
|
||||
let groupIdIndex = 0
|
||||
|
||||
|
@ -51,7 +51,7 @@ Menu.prototype.popup = function (options = {}) {
|
|||
if (options == null || typeof options !== 'object') {
|
||||
throw new TypeError('Options must be an object')
|
||||
}
|
||||
let {window, x, y, positioningItem, callback} = options
|
||||
let { window, x, y, positioningItem, callback } = options
|
||||
|
||||
// no callback passed
|
||||
if (!callback || typeof callback !== 'function') callback = () => {}
|
||||
|
@ -175,7 +175,7 @@ Menu.buildFromTemplate = function (template) {
|
|||
// validate the template against having the wrong attribute
|
||||
function areValidTemplateItems (template) {
|
||||
return template.every(item =>
|
||||
item != null && typeof item === 'object' && (item.hasOwnProperty('label') || item.hasOwnProperty('role') || item.type === 'separator'))
|
||||
item != null && typeof item === 'object' && (item.hasOwnProperty('label') || item.hasOwnProperty('role') || item.type === 'separator'))
|
||||
}
|
||||
|
||||
function sortTemplate (template) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue