@@ -96,15 +96,15 @@ function completer (text) {
9696 // scope variables
9797 for ( const def in scope ) {
9898 if ( scope . hasOwnProperty ( def ) ) {
99- if ( def . indexOf ( keyword ) == 0 ) {
99+ if ( def . indexOf ( keyword ) === 0 ) {
100100 matches . push ( def )
101101 }
102102 }
103103 }
104104
105105 // commandline keywords
106106 [ 'exit' , 'quit' , 'clear' ] . forEach ( function ( cmd ) {
107- if ( cmd . indexOf ( keyword ) == 0 ) {
107+ if ( cmd . indexOf ( keyword ) === 0 ) {
108108 matches . push ( cmd )
109109 }
110110 } )
@@ -113,7 +113,7 @@ function completer (text) {
113113 const ignore = [ 'expr' , 'type' ]
114114 for ( const func in math ) {
115115 if ( math . hasOwnProperty ( func ) ) {
116- if ( func . indexOf ( keyword ) == 0 && ignore . indexOf ( func ) == - 1 ) {
116+ if ( func . indexOf ( keyword ) === 0 && ignore . indexOf ( func ) = == - 1 ) {
117117 matches . push ( func )
118118 }
119119 }
@@ -123,7 +123,7 @@ function completer (text) {
123123 const Unit = math . type . Unit
124124 for ( let name in Unit . UNITS ) {
125125 if ( Unit . UNITS . hasOwnProperty ( name ) ) {
126- if ( name . indexOf ( keyword ) == 0 ) {
126+ if ( name . indexOf ( keyword ) === 0 ) {
127127 matches . push ( name )
128128 }
129129 }
@@ -133,13 +133,13 @@ function completer (text) {
133133 const prefixes = Unit . PREFIXES [ name ]
134134 for ( const prefix in prefixes ) {
135135 if ( prefixes . hasOwnProperty ( prefix ) ) {
136- if ( prefix . indexOf ( keyword ) == 0 ) {
136+ if ( prefix . indexOf ( keyword ) === 0 ) {
137137 matches . push ( prefix )
138- } else if ( keyword . indexOf ( prefix ) == 0 ) {
138+ } else if ( keyword . indexOf ( prefix ) === 0 ) {
139139 const unitKeyword = keyword . substring ( prefix . length )
140140 for ( const n in Unit . UNITS ) {
141141 if ( Unit . UNITS . hasOwnProperty ( n ) ) {
142- if ( n . indexOf ( unitKeyword ) == 0 &&
142+ if ( n . indexOf ( unitKeyword ) === 0 &&
143143 Unit . isValuelessUnit ( prefix + n ) ) {
144144 matches . push ( prefix + n )
145145 }
@@ -153,7 +153,7 @@ function completer (text) {
153153
154154 // remove duplicates
155155 matches = matches . filter ( function ( elem , pos , arr ) {
156- return arr . indexOf ( elem ) == pos
156+ return arr . indexOf ( elem ) === pos
157157 } )
158158 }
159159
@@ -229,7 +229,7 @@ function runStream (input, output, mode, parenthesis) {
229229 if ( node ) {
230230 if ( math . type . isAssignmentNode ( node ) ) {
231231 const name = findSymbolName ( node )
232- if ( name != null ) {
232+ if ( name !== null ) {
233233 scope . ans = scope [ name ]
234234 console . log ( name + ' = ' + format ( scope [ name ] ) )
235235 } else {
0 commit comments