Skip to content

Commit

Permalink
perf(minisearch): replaces Object.keys with hasOwnProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
stalniy authored and lucaong committed Apr 10, 2020
1 parent e75a241 commit 8415007
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/MiniSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ class MiniSearch {
* // => throws 'MiniSearch: unknown option "notExisting"'
*/
static getDefault (optionName) {
const validKeys = Object.keys(defaultOptions)
if (validKeys.includes(optionName)) {
if (defaultOptions.hasOwnProperty(optionName)) {
return defaultOptions[optionName]
} else {
throw new Error(`MiniSearch: unknown option "${optionName}"`)
Expand Down

0 comments on commit 8415007

Please sign in to comment.