Replace custom function with Object.values()

This commit is contained in:
kaylie 2018-02-05 20:03:28 -08:00
Родитель 5240352326
Коммит 3c64062f69
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -7,11 +7,6 @@ const fs = require('fs')
const path = require('path')
const url = require('url')
// TODO(zcbenz): Remove this when we have Object.values().
const objectValues = function (object) {
return Object.keys(object).map(function (key) { return object[key] })
}
// Mapping between extensionId(hostname) and manifest.
const manifestMap = {} // extensionId => manifest
const manifestNameMap = {} // name => manifest
@ -110,7 +105,7 @@ const removeBackgroundPages = function (manifest) {
}
const sendToBackgroundPages = function (...args) {
for (const page of objectValues(backgroundPages)) {
for (const page of Object.values(backgroundPages)) {
page.webContents.sendToAll(...args)
}
}
@ -297,7 +292,7 @@ app.on('web-contents-created', function (event, webContents) {
hookWebContentsEvents(webContents)
webContents.on('devtools-opened', function () {
loadDevToolsExtensions(webContents, objectValues(manifestMap))
loadDevToolsExtensions(webContents, Object.values(manifestMap))
})
})