Skip to content

Commit e81a8b8

Browse files
committed
fix: inline noreply suffixes in utils and remove unused noreplyEmailProviders from enums (CM-1137)
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 496514c commit e81a8b8

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

services/apps/merge_suggestions_worker/src/enums.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ export const EMAIL_AS_USERNAME_PLATFORMS = [
1515
PlatformType.GERRIT,
1616
]
1717

18-
export const noreplyEmailProviders = {
19-
github: '@users.noreply.github.com',
20-
gitlab: '@users.noreply.gitlab.com',
21-
} as const

services/apps/merge_suggestions_worker/src/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { ILLMConsumableMember, PlatformType } from '@crowd/types'
22

3-
import { EMAIL_AS_USERNAME_PLATFORMS, noreplyEmailProviders } from './enums'
3+
import { EMAIL_AS_USERNAME_PLATFORMS } from './enums'
4+
5+
const NOREPLY_SUFFIXES = ['@users.noreply.github.com', '@users.noreply.gitlab.com']
46

57
function isNoreplyEmail(value: string): boolean {
68
const lower = value.toLowerCase()
7-
return Object.values(noreplyEmailProviders).some((s) => lower.endsWith(s))
9+
return NOREPLY_SUFFIXES.some((s) => lower.endsWith(s))
810
}
911

1012
export const prefixLength = (string: string) => {

0 commit comments

Comments
 (0)