* 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)
| 22 | * @returns {boolean} true if it is, false otherwise |
| 23 | */ |
| 24 | function 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) |