diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index f23c498774b86..43612ca8a44f8 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -76,18 +76,14 @@ with an array of misspelt words when complete. An example of using [node-spellchecker][spellchecker] as provider: ```javascript -const {webFrame} = require('electron') +const { webFrame } = require('electron') const spellChecker = require('spellchecker') webFrame.setSpellCheckProvider('en-US', { spellCheck (words, callback) { setTimeout(() => { - let misspeltWords = [] - for (let word of words) { - if (spellChecker.isMisspelled(word)) { - misspeltWords.push(word) - } - } - callback(misspeltWords) + const spellchecker = require('spellchecker') + const misspelled = words.filter(x => spellchecker.isMisspelled(x)) + callback(misspelled) }, 0) } }) diff --git a/package-lock.json b/package-lock.json index 92541f9bc475b..dde3a4e939728 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2860,9 +2860,8 @@ } }, "electron-typescript-definitions": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/electron-typescript-definitions/-/electron-typescript-definitions-2.1.1.tgz", - "integrity": "sha512-vrEhi3hhPzUEDLwPGOqScYBLefNKH5r9odp3dy/lqE0nhAmUHBkrwnU5jVga3A2pJW22wzCCB1kwkEoPV7Rq4w==", + "version": "github:electron/electron-typescript-definitions#7aa97efdbf7dde4e87e722d6393dadb61d65235f", + "from": "github:electron/electron-typescript-definitions#7aa97ef", "dev": true, "requires": { "@types/node": "^7.0.18", diff --git a/package.json b/package.json index e2f8deda2f0f1..6908096b38f94 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dugite": "^1.45.0", "electabul": "~0.0.4", "electron-docs-linter": "^2.4.0", - "electron-typescript-definitions": "electron/electron-typescript-definitions#a23ac4b", + "electron-typescript-definitions": "electron/electron-typescript-definitions#7aa97ef", "eslint": "^5.6.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-mocha": "^5.2.0",