MCPcopy Index your code
hub / github.com/dropbox/ts-transform-react-constant-elements / isReactImport

Function isReactImport

src/transform.ts:24–29  ·  view source on GitHub ↗

* Check if this node is a import react node * * @param {ts.Node} node node * @param {ts.SourceFile} sf source file to get text from * @returns {boolean} true if it is, false otherwise

(node: ts.Node, sf: ts.SourceFile)

Source from the content-addressed store, hash-verified

22 * @returns {boolean} true if it is, false otherwise
23 */
24function isReactImport(node: ts.Node, sf: ts.SourceFile): boolean {
25 return (
26 ts.isImportDeclaration(node) &&
27 REACT_REGEX.test(node.moduleSpecifier.getText(sf))
28 );
29}
30
31/**
32 * Check if an attribute is mutable (having non-primitive values)

Callers 1

visitSourceFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected