Skip to content

Commit 3d8a5b8

Browse files
authored
feat: Convert project config manager module to TS (#684)
* WIP * Convert project_config_manager to TS * Rename createHttpPollingDatafileManager to createDefaultHttpPollingDatafileManager * Make jsonSchemaValidator and datafileMAnager public * Clean up * Update DefaultHttpPollingDatafileManager * Update DefaultHttpPollingDatafileManager * Add missing declaration * NIT add space * Clean up * Final clean up * Incorporate comments * Use OnReadyResult from shared_types
1 parent 1b0c036 commit 3d8a5b8

File tree

9 files changed

+331
-397
lines changed

9 files changed

+331
-397
lines changed

packages/optimizely-sdk/lib/core/bucketer/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const RANDOM_POLICY = 'random';
5555
* @return {Object} DecisionResponse DecisionResponse containing variation ID that user has been bucketed into,
5656
* null if user is not bucketed into any experiment and the decide reasons.
5757
*/
58-
export const bucket = function(bucketerParams: BucketerParams): DecisionResponse<string | null> {
58+
export const bucket = function(bucketerParams: BucketerParams): DecisionResponse<string | null> {
5959
const decideReasons: string[] = [];
6060
// Check if user is in a random group; if so, check if user is bucketed into a specific experiment
6161
const experiment = bucketerParams.experimentIdMap[bucketerParams.experimentId];
@@ -164,7 +164,7 @@ export const bucketUserIntoExperiment = function(
164164
bucketingId: string,
165165
userId: string,
166166
logger: LogHandler
167-
): string | null {
167+
): string | null {
168168
const bucketingKey = sprintf('%s%s', bucketingId, group.id);
169169
const bucketValue = _generateBucketValue(bucketingKey);
170170
logger.log(
@@ -187,7 +187,7 @@ export const bucketUserIntoExperiment = function(
187187
export const _findBucket = function(
188188
bucketValue: number,
189189
trafficAllocationConfig: TrafficAllocation[]
190-
): string | null {
190+
): string | null {
191191
for (let i = 0; i < trafficAllocationConfig.length; i++) {
192192
if (bucketValue < trafficAllocationConfig[i].endOfRange) {
193193
return trafficAllocationConfig[i].entityId;

packages/optimizely-sdk/lib/core/project_config/project_config_manager.d.ts

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)