Skip to content

Commit d5c3a0c

Browse files
Merge pull request #59 from codedbychavez/v2.6.3
V2.6.3
2 parents f6347ff + be306f2 commit d5c3a0c

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

dist/components/FeatureWrapper.vue.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { User } from '@configcat/sdk';
1+
import { IUser } from '@configcat/sdk';
22
type __VLS_Props = {
33
featureKey: string;
4-
userObject?: User;
4+
userObject?: IUser;
55
};
66
declare function __VLS_template(): {
77
attrs: Partial<{}>;

dist/configcat-vue.js

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class He {
2626
function bt(n, e) {
2727
let t;
2828
return new Promise((i) => {
29-
const s = e == null ? void 0 : e.registerCallback(() => {
29+
const s = e?.registerCallback(() => {
3030
clearTimeout(t), i(!1);
3131
});
3232
t = setTimeout(() => {
33-
s == null || s(), i(!0);
33+
s?.(), i(!0);
3434
}, n);
3535
});
3636
}
37-
const wt = typeof performance < "u" && P(performance == null ? void 0 : performance.now) ? () => performance.now() : () => (/* @__PURE__ */ new Date()).getTime();
37+
const wt = typeof performance < "u" && P(performance?.now) ? () => performance.now() : () => (/* @__PURE__ */ new Date()).getTime();
3838
function Yt(n) {
3939
return new xn(n);
4040
}
@@ -119,7 +119,7 @@ function P(n) {
119119
return typeof n == "function";
120120
}
121121
function Zt(n) {
122-
return P(n == null ? void 0 : n.then);
122+
return P(n?.then);
123123
}
124124
function ct(n, e, t) {
125125
return ot(n) || ve(n, e, "boolean", t), n;
@@ -574,7 +574,7 @@ function yt(n, e) {
574574
if (t != null) {
575575
if (i == null)
576576
return !1;
577-
} else if (i != null && i.length)
577+
} else if (i?.length)
578578
return !0;
579579
e || T("Targeting rule THEN part is missing or invalid.");
580580
}
@@ -934,7 +934,7 @@ class mt {
934934
}
935935
prepareClientForEvents() {
936936
var e;
937-
const t = (e = this.options.hooks.unwrap()) === null || e === void 0 ? void 0 : e.configCatClient, i = t == null ? void 0 : t.initConfigService;
937+
const t = (e = this.options.hooks.unwrap()) === null || e === void 0 ? void 0 : e.configCatClient, i = t?.initConfigService;
938938
P(i) && i.call(t, this);
939939
}
940940
dispose() {
@@ -2050,52 +2050,52 @@ class Mi {
20502050
const a = this.evaluateSetting(t);
20512051
return a.returnValue = s = U(a.selectedValue.v, r), a;
20522052
} catch (r) {
2053-
throw i == null || i.resetIndent().increaseIndent(), s = e, r;
2053+
throw i?.resetIndent().increaseIndent(), s = e, r;
20542054
} finally {
20552055
i && (i.newLine(`Returning '${s}'.`).decreaseIndent(), this.logger.settingEvaluated(i.toString()));
20562056
}
20572057
}
20582058
evaluateSetting(e) {
20592059
let t;
20602060
const i = e.setting.r;
2061-
if (i != null && i.length && (t = this.evaluateTargetingRules(i, e)))
2061+
if (i?.length && (t = this.evaluateTargetingRules(i, e)))
20622062
return t;
20632063
const s = e.setting.p;
2064-
return s != null && s.length && (t = this.evaluatePercentageOptions(s, void 0, e)) ? t : Ve(e.setting);
2064+
return s?.length && (t = this.evaluatePercentageOptions(s, void 0, e)) ? t : Ve(e.setting);
20652065
}
20662066
evaluateTargetingRules(e, t) {
20672067
const i = t.logBuilder;
2068-
i == null || i.newLine("Evaluating targeting rules and applying the first match if any:");
2068+
i?.newLine("Evaluating targeting rules and applying the first match if any:");
20692069
for (let s = 0; s < e.length; s++) {
20702070
const r = e[s], o = r.c, a = this.evaluateConditions(o, void 0, r, t.key, t);
20712071
if (a !== !0) {
2072-
S(a) && (i == null || i.increaseIndent().newLine(Vt).decreaseIndent());
2072+
S(a) && i?.increaseIndent().newLine(Vt).decreaseIndent();
20732073
continue;
20742074
}
20752075
if (!yt(r))
20762076
return Ve(r.s, r);
20772077
const l = r.p;
2078-
i == null || i.increaseIndent();
2078+
i?.increaseIndent();
20792079
const c = this.evaluatePercentageOptions(l, r, t);
20802080
if (c)
2081-
return i == null || i.decreaseIndent(), c;
2082-
i == null || i.newLine(Vt).decreaseIndent();
2081+
return i?.decreaseIndent(), c;
2082+
i?.newLine(Vt).decreaseIndent();
20832083
}
20842084
}
20852085
evaluatePercentageOptions(e, t, i) {
20862086
const s = i.logBuilder;
20872087
if (!i.user) {
2088-
s == null || s.newLine("Skipping % options because the User Object is missing."), i.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(i.key), i.isMissingUserObjectLogged = !0);
2088+
s?.newLine("Skipping % options because the User Object is missing."), i.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(i.key), i.isMissingUserObjectLogged = !0);
20892089
return;
20902090
}
20912091
let r = i.setting.a, o;
20922092
if (r == null ? (r = "Identifier", o = Cn(i.user)) : o = jt(i.user, r), o == null) {
2093-
s == null || s.newLine(`Skipping % options because the User.${r} attribute is missing.`), i.isMissingUserObjectAttributeLogged || (this.logger.userObjectAttributeIsMissingPercentage(i.key, r), i.isMissingUserObjectAttributeLogged = !0);
2093+
s?.newLine(`Skipping % options because the User.${r} attribute is missing.`), i.isMissingUserObjectAttributeLogged || (this.logger.userObjectAttributeIsMissingPercentage(i.key, r), i.isMissingUserObjectAttributeLogged = !0);
20942094
return;
20952095
}
2096-
s == null || s.newLine(`Evaluating % options based on the User.${r} attribute:`);
2096+
s?.newLine(`Evaluating % options based on the User.${r} attribute:`);
20972097
const a = pn(i.key + bn(o)), l = parseInt(a.substring(0, 7), 16) % 100;
2098-
s == null || s.newLine(`- Computing hash in the [0..99] range from User.${r} => ${l} (this value is sticky and consistent across all SDKs)`);
2098+
s?.newLine(`- Computing hash in the [0..99] range from User.${r} => ${l} (this value is sticky and consistent across all SDKs)`);
20992099
let c = 0;
21002100
for (let f = 0; f < e.length; f++) {
21012101
const u = e[f], h = u.p;
@@ -2114,9 +2114,9 @@ class Mi {
21142114
let a = !0;
21152115
const l = r.logBuilder;
21162116
let c = !1;
2117-
l == null || l.newLine("- ");
2117+
l?.newLine("- ");
21182118
const f = !t;
2119-
for (let u = 0, h = (o = e == null ? void 0 : e.length) !== null && o !== void 0 ? o : 0; u < h; u++) {
2119+
for (let u = 0, h = (o = e?.length) !== null && o !== void 0 ? o : 0; u < h; u++) {
21202120
let g;
21212121
if (f) {
21222122
const E = e[u];
@@ -2140,11 +2140,11 @@ class Mi {
21402140
if (l && ((!i || h > 1) && l.appendConditionConsequence(d), l.decreaseIndent()), !d)
21412141
break;
21422142
}
2143-
return i && (l == null || l.appendTargetingRuleConsequence(i, r.settingType, a, c)), a;
2143+
return i && l?.appendTargetingRuleConsequence(i, r.settingType, a, c), a;
21442144
}
21452145
evaluateUserCondition(e, t, i) {
21462146
const s = i.logBuilder;
2147-
if (s == null || s.appendUserCondition(e), !i.user)
2147+
if (s?.appendUserCondition(e), !i.user)
21482148
return i.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(i.key), i.isMissingUserObjectLogged = !0), je;
21492149
const r = e.a, o = jt(i.user, r);
21502150
if (o == null || o === "") {
@@ -2316,7 +2316,7 @@ class Mi {
23162316
}
23172317
evaluatePrerequisiteFlagCondition(e, t) {
23182318
const i = t.logBuilder;
2319-
i == null || i.appendPrerequisiteFlagCondition(e, t.settings);
2319+
i?.appendPrerequisiteFlagCondition(e, t.settings);
23202320
const s = e.f, r = L(t.settings, s) ? t.settings[s] : T("Prerequisite flag is missing."), o = vt(r);
23212321
let a, l;
23222322
if (o !== -1)
@@ -2333,7 +2333,7 @@ class Mi {
23332333
T(`Circular dependency detected between the following depending flags: ${d}.`);
23342334
}
23352335
const f = ye.forPrerequisiteFlag(s, r, t);
2336-
i == null || i.newLine("(").increaseIndent().newLine(`Evaluating prerequisite flag '${s}':`);
2336+
i?.newLine("(").increaseIndent().newLine(`Evaluating prerequisite flag '${s}':`);
23372337
const u = this.evaluateSetting(f);
23382338
c.pop();
23392339
const h = U(u.selectedValue.v, o);
@@ -2348,17 +2348,17 @@ class Mi {
23482348
default:
23492349
T("Comparison operator is invalid.");
23502350
}
2351-
return i == null || i.newLine(`Prerequisite flag evaluation result: '${ce(h)}'.`).newLine("Condition (").appendPrerequisiteFlagCondition(e, t.settings).append(") evaluates to ").appendConditionResult(g).append(".").decreaseIndent().newLine(")"), g;
2351+
return i?.newLine(`Prerequisite flag evaluation result: '${ce(h)}'.`).newLine("Condition (").appendPrerequisiteFlagCondition(e, t.settings).append(") evaluates to ").appendConditionResult(g).append(".").decreaseIndent().newLine(")"), g;
23522352
}
23532353
evaluateSegmentCondition(e, t) {
23542354
const i = t.setting._configSegments, s = t.logBuilder;
2355-
if (s == null || s.appendSegmentCondition(e, i), !t.user)
2355+
if (s?.appendSegmentCondition(e, i), !t.user)
23562356
return t.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(t.key), t.isMissingUserObjectLogged = !0), je;
2357-
const r = e == null ? void 0 : e.s;
2357+
const r = e?.s;
23582358
(!i || !lt(r, 0, i.length - 1)) && T("Segment reference is invalid.");
2359-
const o = i[r], a = o == null ? void 0 : o.n;
2360-
a.length || T("Segment name is missing."), s == null || s.newLine("(").increaseIndent().newLine(`Evaluating segment '${a}':`);
2361-
const l = o == null ? void 0 : o.r, c = this.evaluateConditions(l, "u", void 0, a, t);
2359+
const o = i[r], a = o?.n;
2360+
a.length || T("Segment name is missing."), s?.newLine("(").increaseIndent().newLine(`Evaluating segment '${a}':`);
2361+
const l = o?.r, c = this.evaluateConditions(l, "u", void 0, a, t);
23622362
let f = c;
23632363
if (!S(f))
23642364
switch (e.c) {
@@ -2507,7 +2507,7 @@ function Rn(n, e, t, i) {
25072507
if (e === r.i)
25082508
return { settingKey: s, settingValue: U(r.v, o) };
25092509
const a = r.r;
2510-
if (a != null && a.length)
2510+
if (a?.length)
25112511
for (let c = 0; c < a.length; c++) {
25122512
const f = a[c];
25132513
if (yt(f)) {
@@ -2524,7 +2524,7 @@ function Rn(n, e, t, i) {
25242524
}
25252525
}
25262526
const l = r.p;
2527-
if (l != null && l.length)
2527+
if (l?.length)
25282528
for (let c = 0; c < l.length; c++) {
25292529
const f = l[c];
25302530
if (e === f.i)
@@ -2599,7 +2599,7 @@ class B {
25992599
(t = e.logger) === null || t === void 0 || t.debug("finalize() called."), e.cacheToken && oe.remove(e.sdkKey, e.cacheToken), B.close(e.configService, e.logger);
26002600
}
26012601
static close(e, t, i) {
2602-
t == null || t.debug("close() called."), i == null || i.tryDisconnect(), e == null || e.dispose();
2602+
t?.debug("close() called."), i?.tryDisconnect(), e?.dispose();
26032603
}
26042604
dispose() {
26052605
const e = this.options;
@@ -2662,7 +2662,7 @@ class B {
26622662
} catch (o) {
26632663
return this.options.logger.settingEvaluationError("getAllValuesAsync", t, o), [];
26642664
}
2665-
r != null && r.length && this.options.logger.settingEvaluationError("getAllValuesAsync", "evaluation result", typeof AggregateError == "function" ? AggregateError(r) : r.pop());
2665+
r?.length && this.options.logger.settingEvaluationError("getAllValuesAsync", "evaluation result", typeof AggregateError == "function" ? AggregateError(r) : r.pop());
26662666
for (const o of s)
26672667
this.hooks.emit("flagEvaluated", o);
26682668
return i;
@@ -2678,7 +2678,7 @@ class B {
26782678
} catch (r) {
26792679
return this.options.logger.settingEvaluationError("getAllValueDetailsAsync", t, r), [];
26802680
}
2681-
s != null && s.length && this.options.logger.settingEvaluationError("getAllValueDetailsAsync", "evaluation result", typeof AggregateError == "function" ? AggregateError(s) : s.pop());
2681+
s?.length && this.options.logger.settingEvaluationError("getAllValueDetailsAsync", "evaluation result", typeof AggregateError == "function" ? AggregateError(s) : s.pop());
26822682
for (const r of i)
26832683
this.hooks.emit("flagEvaluated", r);
26842684
return i;
@@ -3051,7 +3051,7 @@ class Ji {
30513051
} catch (u) {
30523052
throw u instanceof DOMException && u.name === "AbortError" ? !((s = c.signal) === null || s === void 0) && s.aborted ? new _("timeout", l) : new _("abort") : new _("failure", u);
30533053
} finally {
3054-
f == null || f();
3054+
f?.();
30553055
}
30563056
}
30573057
setRequestHeaders(e, t) {
@@ -3079,7 +3079,7 @@ class Ln extends Ji {
30793079
};
30803080
}
30813081
}
3082-
const Gi = "2.6.1", is = {
3082+
const Gi = "2.6.3", is = {
30833083
// Vue's `App.prototype.use` does not play nicely with generic `install` functions, so we resort to using a discriminated union.
30843084
install: (n, e) => {
30853085
const { sdkKey: t, pollingMode: i, clientOptions: s } = e, r = {

0 commit comments

Comments
 (0)