mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-18 04:35:25 +00:00
18 lines
473 B
TypeScript
18 lines
473 B
TypeScript
/**
|
|
* Get the first part of envVar
|
|
* @param envVar to be split
|
|
* @param separator of the split
|
|
*/
|
|
export function get_first_part(envVar: string, separator: string): string {
|
|
return envVar.replace(RegExp(`${separator}.*$`), '')
|
|
}
|
|
|
|
/**
|
|
* Get the second part of envVar
|
|
* @param envVar to be split
|
|
* @param separator of the split
|
|
*/
|
|
export function get_second_part(envVar: string, separator: string): string {
|
|
return envVar.replace(RegExp(`^.*${separator}`), '')
|
|
}
|