chore: update to standard 12

This commit is contained in:
Samuel Attard 2018-09-14 02:10:51 +10:00
parent 9e85bdb02c
commit 558fff69e7
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
198 changed files with 4455 additions and 2940 deletions

View file

@ -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) {