Skip to content

Commit e621e1b

Browse files
committed
work around typescript
1 parent 57d4568 commit e621e1b

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

modules/branch-keystore-node/src/kms_config.ts

+18-6
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,23 @@ export class KmsKeyConfig implements RegionalKmsConfig {
8181
readOnlyProperty(this, '_config', config)
8282
/* Precondition: config must be a string or object */
8383
const configType = typeof config
84-
needs(!!config && (configType === 'object' || configType === 'string'), 'Config must be a `discovery` or an object.')
84+
needs(
85+
!!config && (configType === 'object' || configType === 'string'),
86+
'Config must be a `discovery` or an object.'
87+
)
88+
const asdf = config
89+
8590
if (configType === 'string') {
8691
/* Precondition: Only `discovery` is a valid string value */
8792
needs(config === 'discovery', 'Unexpected config shape')
88-
} else if ('identifier' in config || 'mrkIdentifier' in config) {
93+
} else if (
94+
'identifier' in (config as any) ||
95+
'mrkIdentifier' in (config as any)
96+
) {
8997
const arn =
90-
'identifier' in config ? config.identifier : config.mrkIdentifier
98+
'identifier' in (config as any)
99+
? (config as any).identifier
100+
: (config as any).mrkIdentifier
91101
/* Precondition: ARN must be a string */
92102
needs(typeof arn === 'string', 'ARN must be a string')
93103

@@ -107,8 +117,8 @@ export class KmsKeyConfig implements RegionalKmsConfig {
107117

108118
readOnlyProperty(this, '_parsedArn', parsedArn)
109119
readOnlyProperty(this, '_arn', arn)
110-
} else if ('region' in config) {
111-
readOnlyProperty(this, '_mrkRegion', config.region)
120+
} else if ('region' in (config as any)) {
121+
readOnlyProperty(this, '_mrkRegion', (config as any).region)
112122
} else {
113123
needs(false, 'Unexpected config shape')
114124
}
@@ -213,7 +223,9 @@ export class KmsKeyConfig implements RegionalKmsConfig {
213223
//# If the KMS Configuration is MRDiscovery, `KeyId` MUST be the `kms-arn` attribute value of the AWS DDB response item, with the region replaced by the configured region.
214224
const parsedArn = parseAwsKmsKeyArn(otherArn)
215225
needs(parsedArn, 'KMS ARN from the keystore is not an ARN:' + otherArn)
216-
return isMultiRegionAwsKmsArn(parsedArn) ? constructArnInOtherRegion(parsedArn, this._mrkRegion) : otherArn
226+
return isMultiRegionAwsKmsArn(parsedArn)
227+
? constructArnInOtherRegion(parsedArn, this._mrkRegion)
228+
: otherArn
217229
} else if (
218230
'identifier' in this._config ||
219231
'mrkIdentifier' in this._config

0 commit comments

Comments
 (0)