Skip to content

Commit

Permalink
fix: cleanCli undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Oct 26, 2019
1 parent 0860955 commit 185ebb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cleaner.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ const regexCli = /([-]{2})([0-9a-z-_]+)/i;
* @returns {String} The cleaned cli
*/
const cleanCli = function(cli, skipRegex = false) {
if (cli !== undefined && typeof cli === 'string') {
if (typeof cli === 'string') {
if (cli.match(/<code\>/i) || cli.match(/<\/code\>/i)) {
cli = cli.replace(/<code\>/gi, '');
cli = cli.replace(/<\/code\>/gi, '');
cli = cli.replace(/\>/gi, '');
cli = cli.replace(/</gi, '');
}
}
if (!cli.match(regexCli) && skipRegex === false) {
cli = undefined;
if (!cli.match(regexCli) && skipRegex === false) {
cli = undefined;
}
}
return cli;
};
Expand Down

0 comments on commit 185ebb2

Please sign in to comment.