@@ -8,7 +8,7 @@ import { objectsAreDeepEqual } from '../utilities/objectUtilities';
8
8
* A base class for flag file.
9
9
* @internal
10
10
*/
11
- export class FlagFile < T extends object = JsonObject > {
11
+ export class FlagFile {
12
12
/**
13
13
* Flag file path
14
14
*/
@@ -17,14 +17,14 @@ export class FlagFile<T extends object = JsonObject> {
17
17
/**
18
18
* Content of the flag
19
19
*/
20
- protected _state : T | { } ;
20
+ private _state : JsonObject ;
21
21
22
22
/**
23
23
* Creates a new flag file
24
24
* @param folderPath - the folder that this flag is managing
25
25
* @param state - optional, the state that should be managed or compared
26
26
*/
27
- public constructor ( folderPath : string , flagName : string , initialState ?: T ) {
27
+ public constructor ( folderPath : string , flagName : string , initialState ?: JsonObject ) {
28
28
this . path = `${ folderPath } /${ flagName } .flag` ;
29
29
this . _state = initialState || { } ;
30
30
}
@@ -33,10 +33,10 @@ export class FlagFile<T extends object = JsonObject> {
33
33
* Returns true if the file exists and the contents match the current state.
34
34
*/
35
35
public async isValidAsync ( ) : Promise < boolean > {
36
- let oldState : T | undefined ;
36
+ let oldState : JsonObject | undefined ;
37
37
try {
38
38
oldState = await JsonFile . loadAsync ( this . path ) ;
39
- const newState : T | { } = this . _state ;
39
+ const newState : JsonObject = this . _state ;
40
40
return objectsAreDeepEqual ( oldState , newState ) ;
41
41
} catch ( err ) {
42
42
return false ;
0 commit comments