Skip to content

Commit f45c1d8

Browse files
author
Fitz
committed
bugfix: 修复去除sources 的content 的协议 去除不干净的bug
1 parent 909f8d2 commit f45c1d8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ export function sourcesValidate(sources: Array<SourceConfig>): Array<string> {
270270

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

276276
}
277-
i.content = content.substring(indexOf + 1);
277+
i.content = content.substring(indexOf + 2);
278278

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

0 commit comments

Comments
 (0)