Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
} else {
this.__configObj = null;
}
if (config.sdkKey) {
var datafileManagerConfig = {
sdkKey: config.sdkKey,
};
if (this.__validateDatafileOptions(config.datafileOptions)) {
fns.assign(datafileManagerConfig, config.datafileOptions);
}
if (initialDatafile && this.__configObj) {
datafileManagerConfig.datafile = initialDatafile;
}
this.datafileManager = new datafileManager.HttpPollingDatafileManager(datafileManagerConfig);
this.datafileManager.start();
this.__readyPromise = this.datafileManager.onReady().then(
this.__onDatafileManagerReadyFulfill.bind(this),
this.__onDatafileManagerReadyReject.bind(this)
);
this.datafileManager.on('update', this.__onDatafileManagerUpdate.bind(this));
} else if (this.__configObj) {
this.__readyPromise = Promise.resolve({
success: true,
});
} else {
this.__readyPromise = Promise.resolve({
success: false,
reason: getErrorMessage(projectConfigCreationEx, 'Invalid datafile'),
});
}