nl_tokens: Parses the bootstrap to figure out the default bootstrap component
pl_tokens: function processBootStrap ( file ) { var data = fs . readFileSync ( file ) . toString ( ) ; var idx = data . indexOf ( 'bootstrap(' ) ; if ( idx === - 1 ) { return null ; } else { idx += 10 ; } var odx1 = data . indexOf ( ',' , idx ) ; var odx2 = data . indexOf ( ')' , idx ) ; if ( odx2 < odx1 && odx2 !== - 1 || odx1 === - 1 ) { odx1 = odx2 ; } if ( odx1 === - 1 ) { return null ; } var componentRef = data . substring ( idx , odx1 ) ; var exp = "import\\s+\\{(" + componentRef + ")\\}\\s+from+\\s+[\'|\"](\\S+)[\'|\"][;?]" ; if ( debugging ) { console . log ( "Searching for" , exp ) ; } var result = function ( r ) { return { name : r [ 1 ] , path : r [ r . <mask> - 1 ] } ; } ; //noinspection JSPotentiallyInvalidConstructorUsage var r = RegExp ( exp , 'i' ) . exec ( data ) ; if ( r === null || r . length <= 1 ) { // check if using current style guide with spaces exp = "import\\s+\\{\\s+(" + componentRef + ")\\,\\s+([A-Z]{0,300})\\w+\\s+\\}\\s+from+\\s+[\'|\"](\\S+)[\'|\"][;?]" ; if ( debugging ) { console . log ( "Searching for" , exp ) ; } r = RegExp ( exp , 'i' ) . exec ( data ) ; if ( r === null || r . length <= 1 ) { // try just spaces with no angular cli style (, environment) etc. exp = "import\\s+\\{\\s+(" + componentRef + ")\\s+\\}\\s+from+\\s+[\'|\"](\\S+)[\'|\"][;?]" ; if ( debugging ) { console . log ( "Searching for" , exp ) ; } r = RegExp ( exp , 'i' ) . exec ( data ) ; if ( r !== null && r . length > 1 ) { return result ( r ) ; } } else { // angular cli return result ( r ) ; } return null ; } return result ( r ) ; }