| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5d33c96 commit 5ce2ac8
1 file 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 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments