Skip to content

Commit

Permalink
Create a set of allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
evosch committed Dec 6, 2018
1 parent 7839772 commit b52fecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/style-prop-object.js
Expand Up @@ -35,7 +35,7 @@ module.exports = {
},

create: function(context) {
const allowed = context.options.length > 0 && context.options[0].allow || [];
const allowed = context.options.length > 0 && new Set(context.options[0].allow || []);

/**
* @param {object} node An Identifier node
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = {
const componentName = node.arguments[0].name;

// allowed list contains the name
if (allowed.indexOf(componentName) > -1) {
if (allowed.has(componentName)) {
// abort operation
return;
}
Expand Down

0 comments on commit b52fecc

Please sign in to comment.