File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ putIn.run([
231
231
232
232
testMe . complete ( 'proxy.' , common . mustCall ( function ( error , data ) {
233
233
assert . strictEqual ( error , null ) ;
234
+ assert ( Array . isArray ( data ) ) ;
234
235
} ) ) ;
235
236
236
237
// Make sure tab completion does not include integer members of an Array
@@ -307,9 +308,7 @@ const testCustomCompleterSyncMode = repl.start({
307
308
input : putIn ,
308
309
output : putIn ,
309
310
completer : function completer ( line ) {
310
- const hits = customCompletions . filter ( ( c ) => {
311
- return c . indexOf ( line ) === 0 ;
312
- } ) ;
311
+ const hits = customCompletions . filter ( ( c ) => c . startsWith ( line ) ) ;
313
312
// Show all completions if none found.
314
313
return [ hits . length ? hits : customCompletions , line ] ;
315
314
}
@@ -339,9 +338,7 @@ const testCustomCompleterAsyncMode = repl.start({
339
338
input : putIn ,
340
339
output : putIn ,
341
340
completer : function completer ( line , callback ) {
342
- const hits = customCompletions . filter ( ( c ) => {
343
- return c . indexOf ( line ) === 0 ;
344
- } ) ;
341
+ const hits = customCompletions . filter ( ( c ) => c . startsWith ( line ) ) ;
345
342
// Show all completions if none found.
346
343
callback ( null , [ hits . length ? hits : customCompletions , line ] ) ;
347
344
}
You can’t perform that action at this time.
0 commit comments