MCPcopy Index your code
hub / github.com/reactjs/react-codemod / isRequire

Function isRequire

transforms/react-to-react-dom.js:46–55  ·  view source on GitHub ↗
(path, moduleName)

Source from the content-addressed store, hash-verified

44}
45
46function isRequire(path, moduleName) {
47 return (
48 path.value.type === 'CallExpression' &&
49 path.value.callee.type === 'Identifier' &&
50 path.value.callee.name === 'require' &&
51 path.value.arguments.length === 1 &&
52 path.value.arguments[0].type === 'Literal' &&
53 path.value.arguments[0].value === moduleName
54 );
55}
56
57module.exports = function(file, api, options) {
58 var j = api.jscodeshift;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected