Skip to content

Commit

Permalink
fix: automatically do replaces instead of expecting user to know them
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Jul 27, 2018
1 parent d25959f commit d8ccf95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/Ondemand/WhereIs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class Whereis extends Command {
rejectUnauthorized: false,
};
query = query.trim().toLowerCase();
options.uri = `${apiBase}/drops/search/${encodeURIComponent(query)}`;
queryWReplaces = query.replace(/prime/ig, 'pr').replace(/blueprint/ig, 'bp');
options.uri = `${apiBase}/drops/search/${encodeURIComponent(queryWReplaces)}`;
const results = await request(options);
const longestName = results.length ? results.map(result => result.item)
.reduce((a, b) => (a.length > b.length ? a : b)) : '';
Expand Down

0 comments on commit d8ccf95

Please sign in to comment.