File tree Expand file tree Collapse file tree
packages/branch-utilities/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,8 +143,8 @@ export function isMainBranch(branchName: string): boolean {
143143 * @throws Throws an error if given branchName does not match our convention
144144 */
145145export function parseBranchName ( branchName : string ) : { branchId : number ; branchName : string } {
146- const matches = REGEX_BRANCH_NAME_DEFAULT . exec ( branchName ) || REGEX_BRANCH_NAME_COPILOT . exec ( branchName )
147- if ( matches && matches . groups ) {
146+ const matches = REGEX_BRANCH_NAME_DEFAULT . exec ( branchName ) ?? REGEX_BRANCH_NAME_COPILOT . exec ( branchName )
147+ if ( matches ? .groups ) {
148148 return {
149149 branchId : parseInt ( matches . groups [ 'id' ] , 10 ) ,
150150 branchName : matches . groups [ 'name' ] ,
@@ -163,7 +163,7 @@ export function parseBranchName(branchName: string): { branchId: number; branchN
163163 * @return returns true if the stage is 'master' or 'main', false if not
164164 */
165165export function isProduction ( stageName : string ) : boolean {
166- return REGEX_MASTER . test ( stageName ) || REGEX_MAIN . test ( stageName )
166+ return REGEX_MASTER . test ( stageName ) ?? REGEX_MAIN . test ( stageName )
167167}
168168
169169/**
You can’t perform that action at this time.
0 commit comments