提交 4b0eef7e 编写于 作者: S sercan

fixing code climate checks

上级 879c7924
......@@ -15,13 +15,8 @@ const fixStringForSingleMatch = function (match, str) {
const regexText = `'${match.substring(match.indexOf('/') + 1, match.lastIndexOf('/'))}'`;
const regexOptions = `'${match.substring(match.lastIndexOf('/') + 1, match.length - 1)}'`;
if (str.substring(str.indexOf(match) - 7, str.indexOf(match))
.indexOf('$regex') !== -1) {
if (regexOptions) {
str = str.replace(match.substring(1, match.length - 1), `${regexText},$options:${regexOptions}`);
} else {
str = str.replace(match.substring(1, match.length - 1), regexText);
}
if (str.substring(str.indexOf(match) - 7, str.indexOf(match)).indexOf('$regex') !== -1) {
str = str.replace(match.substring(1, match.length - 1), regexOptions ? `${regexText},$options:${regexOptions}` : regexText);
} else {
str = str.replace(match.substring(1, match.length - 1), `{$regex:${regexText},$options:${regexOptions}}`);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册