nl_tokens: Extract all required modules from a code string . Copyright ( c ) 2014 - present Facebook Inc . See CREDITS . md#facebook / node - haste
pl_tokens: function getDependencies ( code ) { var cache = Object . create ( null ) ; var deps = [ ] ; function addDependency ( dep ) { if ( ! cache [ dep ] ) { cache [ dep ] = true ; deps . push ( dep ) ; } } <mask> . replace ( replacePatterns . BLOCK_COMMENT_RE , '' ) . replace ( replacePatterns . LINE_COMMENT_RE , '' ) . replace ( replacePatterns . IMPORT_RE , function ( match , pre , quot , dep ) { addDependency ( dep ) ; return match ; } ) . replace ( replacePatterns . EXPORT_RE , function ( match , pre , quot , dep ) { addDependency ( dep ) ; return match ; } ) . replace ( replacePatterns . REQUIRE_RE , function ( match , pre , quot , dep ) { addDependency ( dep ) ; } ) ; return deps ; }