diff options
Diffstat (limited to 'web_src/js/utils.js')
-rw-r--r-- | web_src/js/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js index b555650bc5..6310b2cb99 100644 --- a/web_src/js/utils.js +++ b/web_src/js/utils.js @@ -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}; +} |