Skip to content

Commit

Permalink
bugfix: 修复去除sources 的content 的协议 去除不干净的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitz committed Aug 8, 2022
1 parent 909f8d2 commit f45c1d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ export function sourcesValidate(sources: Array<SourceConfig>): Array<string> {

const content = i.content;
const indexOf = content.indexOf("//");
if (indexOf == content.length -1) {
if (indexOf + 1 == content.length -1) {
errmsgs.push(`sources's NO.${index} item verify fail,sources's content is required!`);

}
i.content = content.substring(indexOf + 1);
i.content = content.substring(indexOf + 2);

const sourcePort = i.port;
if (sourcePort && !(typeof sourcePort == 'number')) {
Expand Down

0 comments on commit f45c1d8

Please sign in to comment.