Skip to content

Commit

Permalink
update resource naming
Browse files Browse the repository at this point in the history
  • Loading branch information
anatheka committed Jul 25, 2023
1 parent de3b2b9 commit 82a653b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ export function trim(s: string, maxLength = 200): string {
}

export function short(resourceID: string) {
// Split resource by / and take the last index
const rr = resourceID.split('/');
// For Azure split resource by / and take the last index
var rr = resourceID.split('/');

// For AWS split resources by : and take the last index
if (rr.length <= 1) {
rr = resourceID.split(':');
}

return rr[rr.length - 1];
}
Expand Down

0 comments on commit 82a653b

Please sign in to comment.