@@ -13,16 +13,17 @@ import { Callback, ns } from '../../utils';
13
13
import { AuthContext , AuthProvider } from './auth_provider' ;
14
14
15
15
/** @public */
16
- export const CANONICALIZATION_VALUES = [
17
- true ,
18
- false ,
19
- 'none' ,
20
- 'forward' ,
21
- 'forwardAndReverse'
22
- ] as const ;
16
+ export const CanonicalizationProperties = Object . freeze ( {
17
+ on : true ,
18
+ off : false ,
19
+ none : 'none' ,
20
+ forward : 'forward' ,
21
+ forwardAndReverse : 'forwardAndReverse'
22
+ } as const ) ;
23
23
24
24
/** @public */
25
- export type CanonicalizationProperties = typeof CANONICALIZATION_VALUES [ number ] ;
25
+ export type CanonicalizationProperties =
26
+ typeof CanonicalizationProperties [ keyof typeof CanonicalizationProperties ] ;
26
27
27
28
type MechanismProperties = {
28
29
/** @deprecated use `CANONICALIZE_HOST_NAME` instead */
@@ -192,10 +193,15 @@ function performGssapiCanonicalizeHostName(
192
193
callback : Callback < string >
193
194
) : void {
194
195
const mode = mechanismProperties . CANONICALIZE_HOST_NAME ;
195
- if ( ! mode || mode === 'none' ) return callback ( undefined , host ) ;
196
+ if ( ! mode || mode === CanonicalizationProperties . none ) {
197
+ return callback ( undefined , host ) ;
198
+ }
196
199
197
200
// If forward and reverse or true
198
- if ( mode === true || mode === 'forwardAndReverse' ) {
201
+ if (
202
+ mode === CanonicalizationProperties . on ||
203
+ mode === CanonicalizationProperties . forwardAndReverse
204
+ ) {
199
205
// Perform the lookup of the ip address.
200
206
dns . lookup ( host , ( error , address ) => {
201
207
// No ip found, return the error.
0 commit comments