We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8b1c5 commit 07a9c02Copy full SHA for 07a9c02
src/services/route53Record/format.ts
@@ -1,10 +1,16 @@
1
+import { isEmpty } from 'lodash'
2
import { AwsRoute53Record } from '../../types/generated'
-import { RawAwsRoute53Record } from './data'
3
import { getHostedZoneId, getRecordId } from '../../utils/ids'
4
+import { RawAwsRoute53Record } from './data'
5
6
// Normalize name due special chars like '*' are replaced with '\\052'
-const normalizeName = (name: string): string =>
7
- name?.replace(/\\052/g, '*').slice(0, -1)
+const normalizeName = (name: string): string => {
8
+ if (isEmpty(name)) return ''
9
+ const normalizedName = name.replace(/\\052/g, '*')
10
+ return normalizedName.endsWith('.')
11
+ ? normalizedName.slice(0, -1)
12
+ : normalizedName
13
+}
14
15
/**
16
* Route53 Record
0 commit comments