summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r--source/libs/utils.ts5
1 files changed, 5 insertions, 0 deletions
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<string>, grouper: (item: string) => string): Record<string, string[]> => {
const map: Record<string, string[]> = {};