Skip to content

Commit

Permalink
fix: Small typo/regex issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mattallty committed Dec 19, 2017
1 parent 3c96cae commit a900fc0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/colorful.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
const chalk = require('chalk');

exports.colorize = (text) => {
return text.replace(/<([a-z0-9-_\.]+)>/gi, (match) => {
return text.replace(/<([a-z0-9-_.]+)>/gi, (match) => {
return chalk.blue(match);
}).replace(/<command>/gi, (match) => {
return chalk.magenta(match);
}).replace(/\[([a-z0-9-_\.]+)\]/gi, (match) => {
}).replace(/\[([a-z0-9-_.]+)\]/gi, (match) => {
return chalk.yellow(match);
}).replace(/ --?([a-z0-9-_\.]+)/gi, (match) => {
}).replace(/ --?([a-z0-9-_.]+)/gi, (match) => {
return chalk.green(match);
});
};
4 changes: 2 additions & 2 deletions lib/error/unknown-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class UnknownOptionError extends BaseError {
let msg = `Unknown option ${chalk.italic(getDashedOption(option))}.`;
if (suggestions.length) {
msg += ' Did you mean ' + suggestions.map(
s => '--' + getBoldDiffString(option, s)
).join(' or maybe ') + ' ?';
s => '--' + getBoldDiffString(option, s)
).join(' or maybe ') + ' ?';
}
super(msg, {option, command}, program);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GetterSetter {
}

getCleanNameFromNotation(str) {
str = str.replace(/([\[\]<>]+)/g, '').replace('...', '');
str = str.replace(/([[\]<>]+)/g, '').replace('...', '');
return camelCase(str);
}

Expand Down

0 comments on commit a900fc0

Please sign in to comment.