Skip to content

Commit

Permalink
[Perf] isCreateElement: improve performance for rules using isCreat…
Browse files Browse the repository at this point in the history
…eElement
  • Loading branch information
golopot authored and ljharb committed Oct 5, 2022
1 parent 5baa3e0 commit d9a51af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/util/isCreateElement.js
Expand Up @@ -10,13 +10,12 @@ const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport
* @returns {Boolean} - True if node is a createElement call object literal, False if not.
*/
module.exports = function isCreateElement(node, context) {
const pragma = pragmaUtil.getFromContext(context);
if (
node.callee
&& node.callee.type === 'MemberExpression'
&& node.callee.property.name === 'createElement'
&& node.callee.object
&& node.callee.object.name === pragma
&& node.callee.object.name === pragmaUtil.getFromContext(context)
) {
return true;
}
Expand Down

0 comments on commit d9a51af

Please sign in to comment.