cordova-plugin-qonversion
Version:
Qonversion Cordova Plugin
22 lines (16 loc) • 696 B
text/typescript
import {RemoteConfig} from './RemoteConfig';
export class RemoteConfigList {
remoteConfigs: Array<RemoteConfig>;
constructor(remoteConfigs: Array<RemoteConfig>) {
this.remoteConfigs = remoteConfigs;
}
remoteConfigForContextKey(contextKey: string): RemoteConfig | undefined {
return this.findRemoteConfigForContextKey(contextKey);
}
remoteConfigForEmptyContextKey(): RemoteConfig | undefined {
return this.findRemoteConfigForContextKey(null);
}
private findRemoteConfigForContextKey(contextKey: string | null): RemoteConfig | undefined {
return this.remoteConfigs.find(config => config.source.contextKey == contextKey);
}
}