From bcb9ed292c93bf81f3f0188e5de9e6b0106409d8 Mon Sep 17 00:00:00 2001 From: Hardik Modha Date: Sat, 11 May 2019 06:29:05 +0530 Subject: Add `tag-changelog-link` feature (#1998) Co-authored-by: Federico Brigante --- source/libs/utils.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/libs/utils.ts') diff --git a/source/libs/utils.ts b/source/libs/utils.ts index a3dea51a..a7ddf562 100644 --- a/source/libs/utils.ts +++ b/source/libs/utils.ts @@ -40,6 +40,11 @@ export const getOwnerAndRepo = (): { return {ownerName, repoName}; }; +export const parseTag = (tag: string): {version: string; namespace: string} => { + const [, namespace = '', version = ''] = tag.match(/(?:(.*)@)?([^@]+)/) || []; + return {namespace, version}; +}; + export const groupBy = (iterable: Iterable, grouper: (item: string) => string): Record => { const map: Record = {}; -- cgit v1.2.3