clean files

This commit is contained in:
Opportunity
2021-07-16 11:08:18 +08:00
Unverified
parent 28277cf90d
commit 1d3e0c37b9
8 changed files with 81 additions and 88 deletions
+6 -4
View File
@@ -1,15 +1,17 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
"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)) throw new Error(`Invalid sha value ${sha}`);
if (!/^[a-f0-9]{40}$/g.test(sha))
throw new Error(`Invalid sha value ${sha}`);
return sha;
}
exports.Sha = Sha;
function Repo(repo) {
repo = repo.trim();
if (!/^([^/#]+\/[^/#]+)$/g.test(repo)) throw new Error(`Invalid repo value ${repo}`);
if (!/^([^/#]+\/[^/#]+)$/g.test(repo))
throw new Error(`Invalid repo value ${repo}`);
return repo;
}
exports.Repo = Repo;