Skip to content

Commit

Permalink
[Refactor] use "has" instead of ".hasOwnProperty"
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 20, 2018
1 parent e2fdc5f commit 412ee2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/no-anonymous-default-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import docsUrl from '../docsUrl'
import has from 'has'

const defs = {
ArrayExpression: {
Expand Down Expand Up @@ -65,7 +66,7 @@ const schemaProperties = Object.keys(defs)
const defaults = Object.keys(defs)
.map((key) => defs[key])
.reduce((acc, def) => {
acc[def.option] = def.hasOwnProperty('default') ? def.default : false
acc[def.option] = has(def, 'default') ? def.default : false
return acc
}, {})

Expand Down

0 comments on commit 412ee2e

Please sign in to comment.