@bscotch/stitch
Version:
Stitch: The GameMaker Studio 2 Asset Pipeline Development Kit.
10 lines • 479 B
JavaScript
import { assert } from '../../utility/errors.js';
export function parseGitHubString(source) {
const match = source.match(/^(?<repoOwner>[a-z0-9_.-]+)\/(?<repoName>[a-z0-9_.-]+)(?<revisionType>(@(?<revision>[a-z0-9_.-]+))|(\?(?<tagPattern>.+)?))?$/i)?.groups;
assert(match, `Invalid GitHub repo string: ${source}`);
if (match?.revisionType) {
match.revisionType = match.revisionType?.[0];
}
return match;
}
//# sourceMappingURL=parseGitHubString.js.map