Fix context popup error (#17398)

* Fix context popup error
This commit is contained in:
wxiaoguang authored and GitHub committed 2021-10-22 22:34:01 +08:00
1 parent 870f5fbc41
commit 406bd3780e
3 files changed
+29 -2

No files matched your search

+6
View File
@@ -57,3 +57,9 @@ export function mqBinarySearch(feature, minValue, maxValue, step, unit) {
}
return mqBinarySearch(feature, minValue, mid - step, step, unit); // feature is < mid
}
export function parseIssueHref(href) {
const path = (href || '').replace(/[#?].*$/, '');
const [_, owner, repo, type, index] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
return {owner, repo, type, index};
}