support other repo

This commit is contained in:
Opportunity
2020-06-30 01:54:04 +08:00
Unverified
parent 2feaa3232f
commit 48f33e8789
66 changed files with 3280 additions and 1532 deletions
+8
View File
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Repo = exports.Sha = void 0;
function Sha(sha) {
sha = sha.trim().toLowerCase();
if (!/^[a-f0-9]{40}$/g.test(sha))
@@ -7,3 +8,10 @@ function Sha(sha) {
return sha;
}
exports.Sha = Sha;
function Repo(repo) {
repo = repo.trim();
if (!/^([^/#]+\/[^/#]+)$/g.test(repo))
throw new Error(`Invalid repo value ${repo}`);
return repo;
}
exports.Repo = Repo;