nl_tokens: Get the required module path or id information
pl_tokens: function getRequiredModulePath ( valuePath , moduleName , t , removeRequireDeclaration = false ) { let bindVar = valuePath . scope . bindings [ moduleName ] ; if ( ! bindVar ) { throw valuePath . buildCodeFrameError ( ` ${ moduleName } ` ) ; } let declareNodePath = bindVar . path ; let parentStatementPath = bindVar . <mask> . getStatementParent ( ) ; // check import statement if ( t . isImportDeclaration ( parentStatementPath ) ) { let id = parentStatementPath . node . source . value ; if ( removeRequireDeclaration ) { let toRemovePath = declareNodePath ; if ( t . isImportDefaultSpecifier ( declareNodePath . node ) ) { toRemovePath = declareNodePath . parentPath ; } removeNode ( t , toRemovePath , { tail : true } ) ; } return id ; } else if ( t . isVariableDeclarator ( declareNodePath ) ) { // check require statement let initNode = declareNodePath . node . init ; let id = getRequireExpressionModuleId ( initNode , t ) ; if ( id ) { removeRequireDeclaration && removeVariableDeclaration ( t , bindVar , { tail : true } ) ; return id ; } } throw valuePath . buildCodeFrameError ( ` ${ moduleName } ` ) ; }