Skip to content

Commit de13951

Browse files
committed
chore: added comments
1 parent bc0a5f9 commit de13951

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: packages/parameters/src/BaseProvider.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ abstract class BaseProvider implements BaseProviderInterface {
8080
const key = [ name, configs.transform ].toString();
8181

8282
if (!configs.forceFetch && !this.hasKeyExpiredInCache(key)) {
83+
// If the code enters in this block, then the key must exist & not have been expired
8384
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8485
return this.store.get(key)!.value;
8586
}
@@ -108,8 +109,9 @@ abstract class BaseProvider implements BaseProviderInterface {
108109
const key = [ path, configs.transform ].toString();
109110

110111
if (!configs.forceFetch && !this.hasKeyExpiredInCache(key)) {
112+
// If the code enters in this block, then the key must exist & not have been expired
111113
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
112-
return this.store.get(key)!.value as Record<string, unknown>; // In this case we know that if it exists, this key corresponds to a Record
114+
return this.store.get(key)!.value as Record<string, unknown>;
113115
}
114116

115117
let values: Record<string, unknown> = {};

0 commit comments

Comments
 (0)