@amplitude/evaluation-js
Advanced tools
Comparing version 0.0.5 to 1.0.0-rc1
(function (root, factory) { | ||
if (typeof define === 'function' && define.amd) | ||
define(['exports', './kotlin_kotlin.js', './kotlin_com_amplitude_evaluation_core.js'], factory); | ||
define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './experiment-evaluation-evaluation-core.js'], factory); | ||
else if (typeof exports === 'object') | ||
factory(module.exports, require('./kotlin_kotlin.js'), require('./kotlin_com_amplitude_evaluation_core.js')); | ||
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./experiment-evaluation-evaluation-core.js')); | ||
else { | ||
if (typeof kotlin_kotlin === 'undefined') { | ||
throw new Error("Error loading module 'experiment-evaluation-evaluation-js'. Its dependency 'kotlin_kotlin' was not found. Please, check whether 'kotlin_kotlin' is loaded prior to 'experiment-evaluation-evaluation-js'."); | ||
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') { | ||
throw new Error("Error loading module 'experiment-evaluation-evaluation-js'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'experiment-evaluation-evaluation-js'."); | ||
} | ||
if (typeof kotlin_com_amplitude_evaluation_core === 'undefined') { | ||
throw new Error("Error loading module 'experiment-evaluation-evaluation-js'. Its dependency 'kotlin_com_amplitude_evaluation_core' was not found. Please, check whether 'kotlin_com_amplitude_evaluation_core' is loaded prior to 'experiment-evaluation-evaluation-js'."); | ||
if (typeof this['experiment-evaluation-evaluation-core'] === 'undefined') { | ||
throw new Error("Error loading module 'experiment-evaluation-evaluation-js'. Its dependency 'experiment-evaluation-evaluation-core' was not found. Please, check whether 'experiment-evaluation-evaluation-core' is loaded prior to 'experiment-evaluation-evaluation-js'."); | ||
} | ||
root['experiment-evaluation-evaluation-js'] = factory(typeof this['experiment-evaluation-evaluation-js'] === 'undefined' ? {} : this['experiment-evaluation-evaluation-js'], kotlin_kotlin, kotlin_com_amplitude_evaluation_core); | ||
root['experiment-evaluation-evaluation-js'] = factory(typeof this['experiment-evaluation-evaluation-js'] === 'undefined' ? {} : this['experiment-evaluation-evaluation-js'], this['kotlin-kotlin-stdlib-js-ir'], this['experiment-evaluation-evaluation-core']); | ||
} | ||
}(this, function (_, kotlin_kotlin, kotlin_com_amplitude_evaluation_core) { | ||
'use strict'; | ||
//region block: imports | ||
var ensureNotNull = kotlin_kotlin.$crossModule$.ensureNotNull; | ||
var StringBuilder_init_$Create$ = kotlin_kotlin.$crossModule$.StringBuilder_init_$Create$; | ||
var Unit_getInstance = kotlin_kotlin.$crossModule$.Unit_getInstance; | ||
var EvaluationEngineImpl = kotlin_com_amplitude_evaluation_core.$crossModule$.EvaluationEngineImpl; | ||
var THROW_CCE = kotlin_kotlin.$crossModule$.THROW_CCE; | ||
var Allocation = kotlin_com_amplitude_evaluation_core.$crossModule$.Allocation; | ||
var EvaluationMode_LOCAL_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.EvaluationMode_LOCAL_getInstance; | ||
var EvaluationMode_REMOTE_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.EvaluationMode_REMOTE_getInstance; | ||
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$crossModule$.IllegalArgumentException_init_$Create$; | ||
var _get_DEFAULT_BUCKETING_KEY__2611303319 = kotlin_com_amplitude_evaluation_core.$crossModule$._get_DEFAULT_BUCKETING_KEY__2611303319; | ||
var FlagConfig = kotlin_com_amplitude_evaluation_core.$crossModule$.FlagConfig; | ||
var MutualExclusionConfig = kotlin_com_amplitude_evaluation_core.$crossModule$.MutualExclusionConfig; | ||
var SegmentTargetingConfig = kotlin_com_amplitude_evaluation_core.$crossModule$.SegmentTargetingConfig; | ||
var Operator_IS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_IS_getInstance; | ||
var Operator_IS_NOT_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_IS_NOT_getInstance; | ||
var Operator_CONTAINS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_CONTAINS_getInstance; | ||
var Operator_DOES_NOT_CONTAIN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_DOES_NOT_CONTAIN_getInstance; | ||
var Operator_LESS_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_LESS_THAN_getInstance; | ||
var Operator_LESS_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_LESS_THAN_EQUALS_getInstance; | ||
var Operator_GREATER_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_GREATER_THAN_getInstance; | ||
var Operator_GREATER_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_GREATER_THAN_EQUALS_getInstance; | ||
var Operator_SET_IS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_SET_IS_getInstance; | ||
var Operator_SET_IS_NOT_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_SET_IS_NOT_getInstance; | ||
var Operator_CSS_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_CSS_MATCH_getInstance; | ||
var Operator_GLOB_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_GLOB_MATCH_getInstance; | ||
var Operator_SET_CONTAINS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_SET_CONTAINS_getInstance; | ||
var Operator_SET_DOES_NOT_CONTAIN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_SET_DOES_NOT_CONTAIN_getInstance; | ||
var Operator_GLOB_DOES_NOT_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_GLOB_DOES_NOT_MATCH_getInstance; | ||
var Operator_VERSION_LESS_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_VERSION_LESS_THAN_getInstance; | ||
var Operator_VERSION_LESS_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_VERSION_LESS_THAN_EQUALS_getInstance; | ||
var Operator_VERSION_GREATER_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_VERSION_GREATER_THAN_getInstance; | ||
var Operator_VERSION_GREATER_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_VERSION_GREATER_THAN_EQUALS_getInstance; | ||
var Operator_HAS_PREFIX_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Operator_HAS_PREFIX_getInstance; | ||
var toSet = kotlin_kotlin.$crossModule$.toSet; | ||
var UserPropertyFilter = kotlin_com_amplitude_evaluation_core.$crossModule$.UserPropertyFilter; | ||
var Variant = kotlin_com_amplitude_evaluation_core.$crossModule$.Variant; | ||
var Keys_getInstance = kotlin_com_amplitude_evaluation_core.$crossModule$.Keys_getInstance; | ||
var SkylabUser_init_$Create$ = kotlin_com_amplitude_evaluation_core.$crossModule$.SkylabUser_init_$Create$; | ||
var ArrayList_init_$Create$ = kotlin_kotlin.$crossModule$.ArrayList_init_$Create$; | ||
var to = kotlin_kotlin.$crossModule$.to; | ||
var toMap = kotlin_kotlin.$crossModule$.toMap; | ||
var isArray = kotlin_kotlin.$crossModule$.isArray; | ||
var arrayIterator = kotlin_kotlin.$crossModule$.arrayIterator; | ||
var isObject = kotlin_kotlin.$crossModule$.isObject; | ||
var ensureNotNull = kotlin_kotlin.$_$.m1; | ||
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f; | ||
var Unit_getInstance = kotlin_kotlin.$_$.i; | ||
var EvaluationEngineImpl = kotlin_com_amplitude_evaluation_core.$_$.c; | ||
var THROW_CCE = kotlin_kotlin.$_$.l1; | ||
var Allocation = kotlin_com_amplitude_evaluation_core.$_$.a; | ||
var EvaluationMode_LOCAL_getInstance = kotlin_com_amplitude_evaluation_core.$_$.h; | ||
var EvaluationMode_REMOTE_getInstance = kotlin_com_amplitude_evaluation_core.$_$.i; | ||
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.g; | ||
var get_DEFAULT_BUCKETING_KEY = kotlin_com_amplitude_evaluation_core.$_$.b; | ||
var FlagConfig = kotlin_com_amplitude_evaluation_core.$_$.d; | ||
var SegmentTargetingConfig = kotlin_com_amplitude_evaluation_core.$_$.e; | ||
var Operator_IS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.s; | ||
var Operator_IS_NOT_getInstance = kotlin_com_amplitude_evaluation_core.$_$.r; | ||
var Operator_CONTAINS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.j; | ||
var Operator_DOES_NOT_CONTAIN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.l; | ||
var Operator_LESS_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.u; | ||
var Operator_LESS_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.t; | ||
var Operator_GREATER_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.p; | ||
var Operator_GREATER_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.o; | ||
var Operator_SET_IS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.y; | ||
var Operator_SET_IS_NOT_getInstance = kotlin_com_amplitude_evaluation_core.$_$.x; | ||
var Operator_CSS_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$_$.k; | ||
var Operator_GLOB_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$_$.n; | ||
var Operator_SET_CONTAINS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.v; | ||
var Operator_SET_DOES_NOT_CONTAIN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.w; | ||
var Operator_GLOB_DOES_NOT_MATCH_getInstance = kotlin_com_amplitude_evaluation_core.$_$.m; | ||
var Operator_VERSION_LESS_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.c1; | ||
var Operator_VERSION_LESS_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.b1; | ||
var Operator_VERSION_GREATER_THAN_getInstance = kotlin_com_amplitude_evaluation_core.$_$.a1; | ||
var Operator_VERSION_GREATER_THAN_EQUALS_getInstance = kotlin_com_amplitude_evaluation_core.$_$.z; | ||
var Operator_HAS_PREFIX_getInstance = kotlin_com_amplitude_evaluation_core.$_$.q; | ||
var toSet = kotlin_kotlin.$_$.p; | ||
var UserPropertyFilter = kotlin_com_amplitude_evaluation_core.$_$.f; | ||
var Variant = kotlin_com_amplitude_evaluation_core.$_$.g; | ||
var Keys_getInstance = kotlin_com_amplitude_evaluation_core.$_$.e1; | ||
var SkylabUser_init_$Create$ = kotlin_com_amplitude_evaluation_core.$_$.d1; | ||
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.b; | ||
var to = kotlin_kotlin.$_$.p1; | ||
var toMap = kotlin_kotlin.$_$.o; | ||
var isArray = kotlin_kotlin.$_$.a1; | ||
var arrayIterator = kotlin_kotlin.$_$.r; | ||
var isObject = kotlin_kotlin.$_$.c1; | ||
//endregion | ||
'use strict'; | ||
//region block: pre-declaration | ||
//endregion | ||
function _get_engine__681495817() { | ||
init_properties_Evaluation_kt_1150878238(); | ||
function get_engine() { | ||
init_properties_Evaluation_kt_j17bby(); | ||
return engine; | ||
@@ -71,30 +70,26 @@ } | ||
function evaluate(rules, user) { | ||
init_properties_Evaluation_kt_1150878238(); | ||
init_properties_Evaluation_kt_j17bby(); | ||
var flagConfigs = ensureNotNull(dynamicListOf(rules, evaluate$lambda())); | ||
var skylabUser = ensureNotNull(dynamicSkylabUser(user)); | ||
var results = _get_engine__681495817().evaluate_ri6v49_k$(flagConfigs, skylabUser); | ||
if (results.isEmpty_y1axqb_k$()) { | ||
var results = get_engine().ya(flagConfigs, skylabUser); | ||
if (results.i()) { | ||
return JSON.parse('{}'); | ||
} | ||
var sb = StringBuilder_init_$Create$(); | ||
sb.append_ssq29y_k$('{'); | ||
Unit_getInstance(); | ||
sb.z7('{'); | ||
{ | ||
var tmp$ret$0; | ||
$l$block: { | ||
tmp$ret$0 = results._get_entries__31877249_iz8n5_k$().iterator_jk1svi_k$(); | ||
break $l$block; | ||
{ | ||
tmp$ret$0 = results.k().d(); | ||
} | ||
var tmp0_iterator_1 = tmp$ret$0; | ||
while (tmp0_iterator_1.hasNext_bitz1p_k$()) { | ||
var element_2 = tmp0_iterator_1.next_20eer_k$(); | ||
var tmp0_iterator = tmp$ret$0; | ||
while (tmp0_iterator.g()) { | ||
var element = tmp0_iterator.e(); | ||
{ | ||
if (!element_2._get_value__3683422336_a43j40_k$()._get_isDefaultVariant__368573885_63ftfh_k$()) { | ||
var flagKey_4 = element_2._get_key__857139730_e6bh8y_k$(); | ||
var variantKey_5 = element_2._get_value__3683422336_a43j40_k$()._get_variant__876436268_eht2jw_k$()._get_key__857139730_e6bh8y_k$(); | ||
var variantPayload_6 = element_2._get_value__3683422336_a43j40_k$()._get_variant__876436268_eht2jw_k$()._get_payload__3508054851_d0i9j1_k$(); | ||
sb.append_ssq29y_k$('"' + flagKey_4 + '":{"value":"' + variantKey_5 + '","payload":' + JSON.stringify(variantPayload_6) + '}'); | ||
Unit_getInstance(); | ||
sb.append_ssq29y_k$(','); | ||
Unit_getInstance(); | ||
if (!element.u().yb_1) { | ||
var flagKey = element.s(); | ||
var variantKey = element.u().wb_1.l9_1; | ||
var variantPayload = element.u().wb_1.m9_1; | ||
sb.z7('"' + flagKey + '":{"value":"' + variantKey + '","payload":' + JSON.stringify(variantPayload) + '}'); | ||
sb.z7(','); | ||
} | ||
@@ -104,8 +99,6 @@ } | ||
} | ||
if (sb._get_length__2347802853_w7ahp7_k$() > 1) { | ||
sb.deleteAt_w9fbwd_k$(sb._get_length__2347802853_w7ahp7_k$() - 1 | 0); | ||
Unit_getInstance(); | ||
if (sb.b2() > 1) { | ||
sb.a8(sb.b2() - 1 | 0); | ||
} | ||
sb.append_ssq29y_k$('}'); | ||
Unit_getInstance(); | ||
sb.z7('}'); | ||
return JSON.parse(sb.toString()); | ||
@@ -118,6 +111,7 @@ } | ||
} | ||
var properties_initialized_Evaluation_kt_2591434818; | ||
function init_properties_Evaluation_kt_1150878238() { | ||
if (!properties_initialized_Evaluation_kt_2591434818) { | ||
properties_initialized_Evaluation_kt_2591434818 = true; | ||
var properties_initialized_Evaluation_kt_s68m2m; | ||
function init_properties_Evaluation_kt_j17bby() { | ||
if (properties_initialized_Evaluation_kt_s68m2m) { | ||
} else { | ||
properties_initialized_Evaluation_kt_s68m2m = true; | ||
engine = new EvaluationEngineImpl(); | ||
@@ -158,37 +152,21 @@ } | ||
var tmp_1 = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(); | ||
var tmp_2 = js.flagName; | ||
var tmp_3 = (!(tmp_2 == null) ? typeof tmp_2 === 'string' : false) ? tmp_2 : THROW_CCE(); | ||
var tmp_4 = js.flagVersion; | ||
var tmp0_elvis_lhs = (!(tmp_4 == null) ? typeof tmp_4 === 'number' : false) ? tmp_4 : null; | ||
var tmp_5 = tmp0_elvis_lhs == null ? 0 : tmp0_elvis_lhs; | ||
var tmp_6 = js.enabled; | ||
var tmp1_elvis_lhs = (!(tmp_6 == null) ? typeof tmp_6 === 'boolean' : false) ? tmp_6 : null; | ||
var tmp_7 = tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs; | ||
var tmp_8 = js.bucketingKey; | ||
var tmp2_elvis_lhs = (!(tmp_8 == null) ? typeof tmp_8 === 'string' : false) ? tmp_8 : null; | ||
var tmp_9 = tmp2_elvis_lhs == null ? _get_DEFAULT_BUCKETING_KEY__2611303319() : tmp2_elvis_lhs; | ||
var tmp_10 = js.bucketingSalt; | ||
var tmp_11 = (tmp_10 == null ? true : typeof tmp_10 === 'string') ? tmp_10 : null; | ||
var tmp_12 = js.useStickyBucketing; | ||
var tmp3_elvis_lhs = (!(tmp_12 == null) ? typeof tmp_12 === 'boolean' : false) ? tmp_12 : null; | ||
var tmp_13 = tmp3_elvis_lhs == null ? false : tmp3_elvis_lhs; | ||
var tmp_14 = js.globalHoldbackSalt; | ||
var tmp_15 = (tmp_14 == null ? true : typeof tmp_14 === 'string') ? tmp_14 : null; | ||
var tmp_16 = js.globalHoldbackPct; | ||
var tmp4_elvis_lhs = (!(tmp_16 == null) ? typeof tmp_16 === 'number' : false) ? tmp_16 : null; | ||
var tmp_17 = tmp4_elvis_lhs == null ? 0 : tmp4_elvis_lhs; | ||
var tmp_18 = dynamicMutualExclusionConfig(js.mutualExclusionConfig); | ||
var tmp_19 = js.defaultValue; | ||
var tmp_20 = (tmp_19 == null ? true : typeof tmp_19 === 'string') ? tmp_19 : null; | ||
var tmp_21 = js.variants; | ||
var tmp_22 = ensureNotNull(dynamicListOf(tmp_21, dynamicFlagConfig$lambda())); | ||
var tmp_23 = js.variantsExclusions; | ||
var tmp_24 = dynamicMapOf(tmp_23, dynamicFlagConfig$lambda_0()); | ||
var tmp_25 = js.variantsInclusions; | ||
var tmp_26 = dynamicMapOf(tmp_25, dynamicFlagConfig$lambda_1()); | ||
var tmp_27 = ensureNotNull(dynamicSegmentTargetingConfig(js.allUsersTargetingConfig)); | ||
var tmp_28 = js.customSegmentTargetingConfigs; | ||
var tmp_29 = dynamicListOf(tmp_28, dynamicFlagConfig$lambda_2()); | ||
var tmp_30 = js.userProperty; | ||
tmp = new FlagConfig(tmp_1, tmp_3, tmp_5, tmp_7, tmp_9, tmp_11, tmp_13, tmp_15, tmp_17, tmp_18, tmp_20, tmp_22, tmp_24, tmp_26, tmp_27, tmp_29, (tmp_30 == null ? true : typeof tmp_30 === 'string') ? tmp_30 : null, dynamicEvaluationMode(js.evalMode)); | ||
var tmp_2 = js.enabled; | ||
var tmp0_elvis_lhs = (!(tmp_2 == null) ? typeof tmp_2 === 'boolean' : false) ? tmp_2 : null; | ||
var tmp_3 = tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs; | ||
var tmp_4 = js.bucketingKey; | ||
var tmp1_elvis_lhs = (!(tmp_4 == null) ? typeof tmp_4 === 'string' : false) ? tmp_4 : null; | ||
var tmp_5 = tmp1_elvis_lhs == null ? get_DEFAULT_BUCKETING_KEY() : tmp1_elvis_lhs; | ||
var tmp_6 = js.bucketingSalt; | ||
var tmp_7 = (tmp_6 == null ? true : typeof tmp_6 === 'string') ? tmp_6 : null; | ||
var tmp_8 = js.defaultValue; | ||
var tmp_9 = (tmp_8 == null ? true : typeof tmp_8 === 'string') ? tmp_8 : null; | ||
var tmp_10 = js.variants; | ||
var tmp_11 = ensureNotNull(dynamicListOf(tmp_10, dynamicFlagConfig$lambda())); | ||
var tmp_12 = js.variantsExclusions; | ||
var tmp_13 = dynamicMapOf(tmp_12, dynamicFlagConfig$lambda_0()); | ||
var tmp_14 = js.variantsInclusions; | ||
var tmp_15 = dynamicMapOf(tmp_14, dynamicFlagConfig$lambda_1()); | ||
var tmp_16 = ensureNotNull(dynamicSegmentTargetingConfig(js.allUsersTargetingConfig)); | ||
var tmp_17 = js.customSegmentTargetingConfigs; | ||
tmp = new FlagConfig(tmp_1, tmp_3, tmp_5, tmp_7, tmp_9, tmp_11, tmp_13, tmp_15, tmp_16, dynamicListOf(tmp_17, dynamicFlagConfig$lambda_2()), dynamicEvaluationMode(js.evalMode)); | ||
} else { | ||
@@ -199,19 +177,2 @@ tmp = null; | ||
} | ||
function dynamicMutualExclusionConfig(js) { | ||
var tmp; | ||
if (js) { | ||
var tmp_0 = js.groupSalt; | ||
var tmp_1 = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(); | ||
var tmp_2 = js.lowerBound; | ||
var tmp_3 = (!(tmp_2 == null) ? typeof tmp_2 === 'number' : false) ? tmp_2 : THROW_CCE(); | ||
var tmp_4 = js.percentage; | ||
var tmp_5 = (!(tmp_4 == null) ? typeof tmp_4 === 'number' : false) ? tmp_4 : THROW_CCE(); | ||
var tmp_6 = js.bucketingKey; | ||
var tmp0_elvis_lhs = (!(tmp_6 == null) ? typeof tmp_6 === 'string' : false) ? tmp_6 : null; | ||
tmp = new MutualExclusionConfig(tmp_1, tmp_3, tmp_5, tmp0_elvis_lhs == null ? _get_DEFAULT_BUCKETING_KEY__2611303319() : tmp0_elvis_lhs); | ||
} else { | ||
tmp = null; | ||
} | ||
return tmp; | ||
} | ||
function dynamicSegmentTargetingConfig(js) { | ||
@@ -328,29 +289,43 @@ var tmp; | ||
if (js) { | ||
var tmp_0 = js[Keys_getInstance()._get_USER_ID__2643438306_rb9zxa_k$()]; | ||
Keys_getInstance(); | ||
var tmp_0 = js['user_id']; | ||
var tmp_1 = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : null; | ||
var tmp_2 = js[Keys_getInstance()._get_DEVICE_ID__4254741293_ny6kz_k$()]; | ||
Keys_getInstance(); | ||
var tmp_2 = js['device_id']; | ||
var tmp_3 = (!(tmp_2 == null) ? typeof tmp_2 === 'string' : false) ? tmp_2 : null; | ||
var tmp_4 = js[Keys_getInstance()._get_COUNTRY__2536629851_t2v9ut_k$()]; | ||
Keys_getInstance(); | ||
var tmp_4 = js['country']; | ||
var tmp_5 = (!(tmp_4 == null) ? typeof tmp_4 === 'string' : false) ? tmp_4 : null; | ||
var tmp_6 = js[Keys_getInstance()._get_REGION__4089430679_3edd2h_k$()]; | ||
Keys_getInstance(); | ||
var tmp_6 = js['region']; | ||
var tmp_7 = (!(tmp_6 == null) ? typeof tmp_6 === 'string' : false) ? tmp_6 : null; | ||
var tmp_8 = js[Keys_getInstance()._get_DMA__855953081_e5m1mh_k$()]; | ||
Keys_getInstance(); | ||
var tmp_8 = js['dma']; | ||
var tmp_9 = (!(tmp_8 == null) ? typeof tmp_8 === 'string' : false) ? tmp_8 : null; | ||
var tmp_10 = js[Keys_getInstance()._get_CITY__763718208_cmp4qo_k$()]; | ||
Keys_getInstance(); | ||
var tmp_10 = js['city']; | ||
var tmp_11 = (!(tmp_10 == null) ? typeof tmp_10 === 'string' : false) ? tmp_10 : null; | ||
var tmp_12 = js[Keys_getInstance()._get_LANGUAGE__1491789683_oo68ab_k$()]; | ||
Keys_getInstance(); | ||
var tmp_12 = js['language']; | ||
var tmp_13 = (!(tmp_12 == null) ? typeof tmp_12 === 'string' : false) ? tmp_12 : null; | ||
var tmp_14 = js[Keys_getInstance()._get_PLATFORM__2254091704_xr31oo_k$()]; | ||
Keys_getInstance(); | ||
var tmp_14 = js['platform']; | ||
var tmp_15 = (!(tmp_14 == null) ? typeof tmp_14 === 'string' : false) ? tmp_14 : null; | ||
var tmp_16 = js[Keys_getInstance()._get_VERSION__923584857_f9vmmx_k$()]; | ||
Keys_getInstance(); | ||
var tmp_16 = js['version']; | ||
var tmp_17 = (!(tmp_16 == null) ? typeof tmp_16 === 'string' : false) ? tmp_16 : null; | ||
var tmp_18 = js[Keys_getInstance()._get_OS__1413095463_ndbjfr_k$()]; | ||
Keys_getInstance(); | ||
var tmp_18 = js['os']; | ||
var tmp_19 = (!(tmp_18 == null) ? typeof tmp_18 === 'string' : false) ? tmp_18 : null; | ||
var tmp_20 = js[Keys_getInstance()._get_DEVICE_FAMILY__3471266052_dmery4_k$()]; | ||
Keys_getInstance(); | ||
var tmp_20 = js['device_family']; | ||
var tmp_21 = (!(tmp_20 == null) ? typeof tmp_20 === 'string' : false) ? tmp_20 : null; | ||
var tmp_22 = js[Keys_getInstance()._get_DEVICE_TYPE__8320622_4yc8e_k$()]; | ||
Keys_getInstance(); | ||
var tmp_22 = js['device_type']; | ||
var tmp_23 = (!(tmp_22 == null) ? typeof tmp_22 === 'string' : false) ? tmp_22 : null; | ||
var tmp_24 = js[Keys_getInstance()._get_CARRIER__2913946425_mu82iv_k$()]; | ||
Keys_getInstance(); | ||
var tmp_24 = js['carrier']; | ||
var tmp_25 = (!(tmp_24 == null) ? typeof tmp_24 === 'string' : false) ? tmp_24 : null; | ||
var tmp_26 = js[Keys_getInstance()._get_USER_PROPERTIES__2224778954_y8jbjq_k$()]; | ||
Keys_getInstance(); | ||
var tmp_26 = js['user_properties']; | ||
tmp = SkylabUser_init_$Create$(tmp_1, tmp_3, null, tmp_5, tmp_7, tmp_9, tmp_11, tmp_13, tmp_15, tmp_17, null, tmp_19, null, null, null, tmp_21, tmp_23, tmp_25, null, null, dynamicMapOf$default(tmp_26, null, 2, null), 816132, null); | ||
@@ -396,28 +371,24 @@ } else { | ||
var tmp$ret$2; | ||
$l$block_1: { | ||
{ | ||
var tmp_0 = Object.entries; | ||
var tmp0_map_0 = ((!(tmp_0 == null) ? typeof tmp_0 === 'function' : false) ? tmp_0 : THROW_CCE())(js); | ||
var tmp0_map = ((!(tmp_0 == null) ? typeof tmp_0 === 'function' : false) ? tmp_0 : THROW_CCE())(js); | ||
var tmp$ret$1; | ||
$l$block_0: { | ||
var tmp0_mapTo_0_1 = ArrayList_init_$Create$(tmp0_map_0.length); | ||
var indexedObject = tmp0_map_0; | ||
{ | ||
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length); | ||
var indexedObject = tmp0_map; | ||
var inductionVariable = 0; | ||
var last = indexedObject.length; | ||
while (inductionVariable < last) { | ||
var item_2_3 = indexedObject[inductionVariable]; | ||
var item = indexedObject[inductionVariable]; | ||
inductionVariable = inductionVariable + 1 | 0; | ||
var tmp$ret$0; | ||
$l$block: { | ||
var tmp_1 = item_2_3[0]; | ||
tmp$ret$0 = to((!(tmp_1 == null) ? typeof tmp_1 === 'string' : false) ? tmp_1 : THROW_CCE(), transform(item_2_3[1])); | ||
break $l$block; | ||
{ | ||
var tmp_1 = item[0]; | ||
tmp$ret$0 = to((!(tmp_1 == null) ? typeof tmp_1 === 'string' : false) ? tmp_1 : THROW_CCE(), transform(item[1])); | ||
} | ||
tmp0_mapTo_0_1.add_1j60pz_k$(tmp$ret$0); | ||
Unit_getInstance(); | ||
tmp0_mapTo.a(tmp$ret$0); | ||
} | ||
tmp$ret$1 = tmp0_mapTo_0_1; | ||
break $l$block_0; | ||
tmp$ret$1 = tmp0_mapTo; | ||
} | ||
tmp$ret$2 = tmp$ret$1; | ||
break $l$block_1; | ||
} | ||
@@ -447,22 +418,18 @@ tmp = tmp$ret$2; | ||
var tmp$ret$2; | ||
$l$block_1: { | ||
{ | ||
var tmp$ret$1; | ||
$l$block_0: { | ||
var tmp0_mapTo_0_1 = ArrayList_init_$Create$(tmp0_safe_receiver.length); | ||
var tmp0_iterator_1_2 = arrayIterator(tmp0_safe_receiver); | ||
while (tmp0_iterator_1_2.hasNext_bitz1p_k$()) { | ||
var item_2_3 = tmp0_iterator_1_2.next_20eer_k$(); | ||
{ | ||
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_safe_receiver.length); | ||
var tmp0_iterator = arrayIterator(tmp0_safe_receiver); | ||
while (tmp0_iterator.g()) { | ||
var item = tmp0_iterator.e(); | ||
var tmp$ret$0; | ||
$l$block: { | ||
tmp$ret$0 = transform(item_2_3); | ||
break $l$block; | ||
{ | ||
tmp$ret$0 = transform(item); | ||
} | ||
tmp0_mapTo_0_1.add_1j60pz_k$(tmp$ret$0); | ||
Unit_getInstance(); | ||
tmp0_mapTo.a(tmp$ret$0); | ||
} | ||
tmp$ret$1 = tmp0_mapTo_0_1; | ||
break $l$block_0; | ||
tmp$ret$1 = tmp0_mapTo; | ||
} | ||
tmp$ret$2 = tmp$ret$1; | ||
break $l$block_1; | ||
} | ||
@@ -469,0 +436,0 @@ tmp = tmp$ret$2; |
{ | ||
"name": "@amplitude/evaluation-js", | ||
"version": "0.0.5", | ||
"version": "1.0.0-rc1", | ||
"main": "experiment-evaluation-evaluation-js.js", | ||
"types": "experiment-evaluation-evaluation-js.d.ts" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
641277
12
15187