File size: 327 Bytes
84c1942
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
export const CSB_PKG_PROTOCOL = /https:\/\/pkg(-staging)?\.csb.dev/;

export const formatVersion = (version: string) => {
  if (CSB_PKG_PROTOCOL.test(version)) {
    const commitSha = version.match(/commit\/([\w\d]*)\//);
    if (commitSha && commitSha[1]) {
      return `csb:${commitSha[1]}`;
    }
  }

  return version;
};