123456789101112131415161718192021222324252627282930313233 |
- 'use strict';
- const pragmaUtil = require('./pragma');
- const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport');
- module.exports = function isCreateElement(node, context) {
- if (
- node.callee
- && node.callee.type === 'MemberExpression'
- && node.callee.property.name === 'createElement'
- && node.callee.object
- && node.callee.object.name === pragmaUtil.getFromContext(context)
- ) {
- return true;
- }
- if (
- node
- && node.callee
- && node.callee.name === 'createElement'
- && isDestructuredFromPragmaImport('createElement', context)
- ) {
- return true;
- }
- return false;
- };
|