@@ -39,7 +39,17 @@ export class EnvAwareBuilder<TEnvironments extends string, T extends Record<stri
3939 }
4040
4141 addEnvironment < TDic extends Record < string , ConfigurationValue > , TPrefix extends string = 'OPT_' > ( env : Record < string , ConfigurationValue > | ( ( ) => Promise < Record < string , ConfigurationValue > > ) , prefix : string = 'OPT_' ) {
42- return this . add < MergeResult < T , InflateDictionary < TDic , '__' , TPrefix > > > ( new EnvironmentDataSource ( env , prefix ) ) ;
42+ /*
43+ InflateDictionary is a utility type that does generate a type that is assignable to Record<string, any>, but in
44+ a way that TypeScript does not understand. It uses a trick to merge individually-inflated keys in individual,
45+ single-property Record's into one record.
46+
47+ So ignoring TS2344 for the time being. Maybe it is my TypeScript's lack of ability, or maybe not.
48+
49+ Time will tell.
50+ */
51+ // @ts -expect-error ts2344
52+ return this . add < InflateDictionary < TDic , '__' , TPrefix > > ( new EnvironmentDataSource ( env , prefix ) ) ;
4353 }
4454
4555 addFetched < NewT extends Record < string , any > > ( input : URL | RequestInfo | ( ( ) => Promise < URL | RequestInfo > ) , required : boolean = true , init ?: RequestInit , procesFn ?: ProcessFetchResponse < NewT > ) {
@@ -51,7 +61,7 @@ export class EnvAwareBuilder<TEnvironments extends string, T extends Record<stri
5161 }
5262
5363 addSingleValue < TKey extends string , TValue extends ConfigurationValue , TSep extends string = ':' > ( path : TKey | ( ( ) => Promise < [ TKey , TValue ] > ) , valueOrHierarchySeparator ?: TValue | TSep , hierarchySeparator ?: TSep ) {
54- return this . add ( new SingleValueDataSource < MergeResult < T , InflateKey < TKey , TValue , TSep > > > ( path , valueOrHierarchySeparator , typeof path === 'function' ? valueOrHierarchySeparator as string : hierarchySeparator ) ) ;
64+ return this . add ( new SingleValueDataSource < InflateKey < TKey , TValue , TSep > > ( path , valueOrHierarchySeparator , typeof path === 'function' ? valueOrHierarchySeparator as string : hierarchySeparator ) ) ;
5565 }
5666
5767 postMerge < U extends Record < string , any > = T > ( fn : ( config : T ) => U | Promise < U > ) : IEnvAwareBuilder < TEnvironments , U > {
0 commit comments