static ImmutableList < Require > getAllRequires ( Node nameDeclaration ) { Node rhs = nameDeclaration . getFirstChild ( ) . isDestructuringLhs ( ) ? nameDeclaration . getFirstChild ( ) . getSecondChild ( ) : nameDeclaration . getFirstFirstChild ( ) ; // This may be a require, requireType, or forwardDeclare. Binding . CreatedBy requireKind = getModuleDependencyTypeFromRhs ( rhs ) ; if ( requireKind == null ) { return ImmutableList . of ( ) ; } return new ClosureRequireProcessor ( nameDeclaration , requireKind ) . getAllRequiresInDeclaration ( ) ; }
Returns all Require built from the given statement or null if it is not a require