@@ -5,7 +5,7 @@ from './mask-impl';
5
5
6
6
import { MaskSet } from './mask-index' ;
7
7
8
- export type AttributeMap = { readonly [ AttributeName in string ] : string | null ; } ;
8
+ export type AttributeMap = Readonly < Record < string , string | null > > ;
9
9
10
10
export interface CompatibilityInfo
11
11
{
@@ -40,14 +40,14 @@ export interface FeatureConstructor
40
40
( ...features : FeatureElementOrCompatibleArray [ ] ) : Feature ;
41
41
42
42
readonly ALL :
43
- { readonly [ FeatureName in string ] : PredefinedFeature ; } ;
43
+ Readonly < Record < string , PredefinedFeature > > ;
44
44
45
45
readonly ELEMENTARY : readonly PredefinedFeature [ ] ;
46
46
47
47
readonly ENGINE : readonly PredefinedFeature [ ] ;
48
48
49
49
readonly FAMILIES :
50
- { readonly [ Family in string ] : readonly CompatibilityInfo [ ] ; } ;
50
+ Readonly < Record < string , CompatibilityInfo [ ] > > ;
51
51
52
52
new ( ...features : FeatureElementOrCompatibleArray [ ] ) : Feature ;
53
53
_fromMask ( mask : Mask ) : Feature | null ;
@@ -71,7 +71,7 @@ export type FeatureInfo =
71
71
readonly aliasFor : string ;
72
72
} |
73
73
{
74
- readonly attributes ?: { readonly [ AttributeName in string ] : string | null | undefined ; } ;
74
+ readonly attributes ?: Readonly < Record < string , string | null | undefined > > ;
75
75
readonly check ?: ( ) => unknown ;
76
76
readonly excludes ?: readonly string [ ] ;
77
77
readonly includes ?: readonly string [ ] | IncludeDifferenceMap ;
@@ -82,7 +82,7 @@ export type FeatureInfo =
82
82
) &
83
83
{ readonly description ?: string ; } ;
84
84
85
- export type IncludeDifferenceMap = { readonly [ FeatureName in string ] : boolean ; } ;
85
+ export type IncludeDifferenceMap = Readonly < Record < string , boolean > > ;
86
86
87
87
export interface PredefinedFeature extends Feature
88
88
{
@@ -122,7 +122,7 @@ function assignNoEnum(target: object, source: object): void
122
122
123
123
export function createFeatureClass
124
124
(
125
- featureInfos : { readonly [ FeatureName in string ] : FeatureInfo ; } ,
125
+ featureInfos : Readonly < Record < string , FeatureInfo > > ,
126
126
formatEngineDescription ?: ( compatibilities : CompatibilityInfo [ ] ) => string ,
127
127
) :
128
128
FeatureConstructor
@@ -436,7 +436,7 @@ FeatureConstructor
436
436
const str = `[Feature ${ name } ]` ;
437
437
return str ;
438
438
} ,
439
- } as { [ PropName in string ] : unknown ; } & ThisType < Feature > ;
439
+ } as Record < string , unknown > & ThisType < Feature > ;
440
440
if ( utilInspect )
441
441
protoSource . inspect = inspect ;
442
442
assignNoEnum ( FEATURE_PROTOTYPE , protoSource ) ;
@@ -483,7 +483,7 @@ FeatureConstructor
483
483
const getInfoStringField =
484
484
< FieldNameType extends string > ( fieldName : FieldNameType ) : string | undefined =>
485
485
fieldName in info ?
486
- esToString ( ( info as { [ Name in FieldNameType ] : unknown ; } ) [ fieldName ] ) : undefined ;
486
+ esToString ( ( info as Record < FieldNameType , unknown > ) [ fieldName ] ) : undefined ;
487
487
let description = getInfoStringField ( 'description' ) ;
488
488
let featureObj : PredefinedFeature ;
489
489
if ( 'aliasFor' in info )
@@ -655,7 +655,7 @@ FeatureConstructor
655
655
}
656
656
657
657
const featureNames = _Object_keys ( featureInfos ) ;
658
- const includeSetMap = createMap < { readonly [ FeatureName in string ] : null ; } > ( ) ;
658
+ const includeSetMap = createMap < Readonly < Record < string , null > > > ( ) ;
659
659
const familiesMap = createMap < readonly string [ ] > ( ) ;
660
660
let unionMask = MASK_EMPTY ;
661
661
@@ -676,7 +676,7 @@ FeatureConstructor
676
676
return Feature as FeatureConstructor ;
677
677
}
678
678
679
- const createMap = < T > ( ) : { [ Key in string ] : T ; } => _Object_create ( null ) as { } ;
679
+ const createMap = < T > ( ) : Record < string , T > => _Object_create ( null ) as { } ;
680
680
681
681
function esToString ( name : unknown ) : string
682
682
{
0 commit comments