@uniformdev/optimize-tracker
Advanced tools
Comparing version 2.0.1-alpha.39 to 2.0.1-alpha.44
@@ -102,3 +102,3 @@ "use strict"; | ||
var compareRelevancyAsc = function (a, b) { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b; | ||
// infinity === no matches, push to bottom | ||
@@ -108,8 +108,7 @@ if (b.relevancy === undefined && a.relevancy === Number.POSITIVE_INFINITY) { | ||
} | ||
if (((_a = a.matches) === null || _a === void 0 ? void 0 : _a.length) === ((_b = b.matches) === null || _b === void 0 ? void 0 : _b.length)) { | ||
return (a.relevancy || 0) - (b.relevancy || 0); | ||
var relevanceDifference = (a.relevancy || 0) - (b.relevancy || 0); | ||
if (relevanceDifference === 0) { | ||
return (((_a = b.matches) === null || _a === void 0 ? void 0 : _a.length) || 0) - (((_b = a.matches) === null || _b === void 0 ? void 0 : _b.length) || 0); | ||
} | ||
var aMatches = (_d = (_c = a.matches) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0; | ||
var bMatches = (_f = (_e = b.matches) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0; | ||
return bMatches - aMatches; | ||
return relevanceDifference; | ||
}; | ||
@@ -116,0 +115,0 @@ /** |
@@ -115,3 +115,3 @@ "use strict"; | ||
_loop_1 = function (currentScope) { | ||
var scoring, updatedScoring_1, somethingWasRemoved_1; | ||
var scoring, updatedScoring_1, somethingWasRemoved_1, writtenScore; | ||
return __generator(this, function (_a) { | ||
@@ -122,19 +122,23 @@ switch (_a.label) { | ||
scoring = _a.sent(); | ||
if (scoring) { | ||
updatedScoring_1 = {}; | ||
somethingWasRemoved_1 = false; | ||
Object.keys(scoring.values).map(function (key) { | ||
if (intent && (intentsToRemove === null || intentsToRemove === void 0 ? void 0 : intentsToRemove.indexOf(key)) === -1) { | ||
updatedScoring_1[key] = scoring.values[key]; | ||
} | ||
else { | ||
somethingWasRemoved_1 = true; | ||
wasSomethingRemovedFromAnyScope = true; | ||
} | ||
}); | ||
if (somethingWasRemoved_1) { | ||
this_1.writeScoring(currentScope, __assign(__assign({}, scoring), { values: updatedScoring_1 }), options === null || options === void 0 ? void 0 : options.quiet); | ||
if (!scoring) return [3 /*break*/, 3]; | ||
updatedScoring_1 = {}; | ||
somethingWasRemoved_1 = false; | ||
Object.keys(scoring.values).map(function (key) { | ||
if (intent && (intentsToRemove === null || intentsToRemove === void 0 ? void 0 : intentsToRemove.indexOf(key)) === -1) { | ||
updatedScoring_1[key] = scoring.values[key]; | ||
} | ||
else { | ||
somethingWasRemoved_1 = true; | ||
wasSomethingRemovedFromAnyScope = true; | ||
} | ||
}); | ||
if (!somethingWasRemoved_1) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, this_1.writeScoring(currentScope, __assign(__assign({}, scoring), { values: updatedScoring_1 }), options === null || options === void 0 ? void 0 : options.quiet)]; | ||
case 2: | ||
writtenScore = _a.sent(); | ||
if (!(options === null || options === void 0 ? void 0 : options.quiet)) { | ||
this_1.broadcastScoring(writtenScore === null || writtenScore === void 0 ? void 0 : writtenScore.values); | ||
} | ||
return [2 /*return*/]; | ||
_a.label = 3; | ||
case 3: return [2 /*return*/]; | ||
} | ||
@@ -957,2 +961,3 @@ }); | ||
scope: targetScope, | ||
quiet: options === null || options === void 0 ? void 0 : options.quiet, | ||
})]; | ||
@@ -959,0 +964,0 @@ case 2: |
@@ -96,3 +96,3 @@ var __assign = (this && this.__assign) || function () { | ||
var compareRelevancyAsc = function (a, b) { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b; | ||
// infinity === no matches, push to bottom | ||
@@ -102,8 +102,7 @@ if (b.relevancy === undefined && a.relevancy === Number.POSITIVE_INFINITY) { | ||
} | ||
if (((_a = a.matches) === null || _a === void 0 ? void 0 : _a.length) === ((_b = b.matches) === null || _b === void 0 ? void 0 : _b.length)) { | ||
return (a.relevancy || 0) - (b.relevancy || 0); | ||
var relevanceDifference = (a.relevancy || 0) - (b.relevancy || 0); | ||
if (relevanceDifference === 0) { | ||
return (((_a = b.matches) === null || _a === void 0 ? void 0 : _a.length) || 0) - (((_b = a.matches) === null || _b === void 0 ? void 0 : _b.length) || 0); | ||
} | ||
var aMatches = (_d = (_c = a.matches) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0; | ||
var bMatches = (_f = (_e = b.matches) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0; | ||
return bMatches - aMatches; | ||
return relevanceDifference; | ||
}; | ||
@@ -110,0 +109,0 @@ /** |
@@ -112,3 +112,3 @@ var __assign = (this && this.__assign) || function () { | ||
_loop_1 = function (currentScope) { | ||
var scoring, updatedScoring_1, somethingWasRemoved_1; | ||
var scoring, updatedScoring_1, somethingWasRemoved_1, writtenScore; | ||
return __generator(this, function (_a) { | ||
@@ -119,19 +119,23 @@ switch (_a.label) { | ||
scoring = _a.sent(); | ||
if (scoring) { | ||
updatedScoring_1 = {}; | ||
somethingWasRemoved_1 = false; | ||
Object.keys(scoring.values).map(function (key) { | ||
if (intent && (intentsToRemove === null || intentsToRemove === void 0 ? void 0 : intentsToRemove.indexOf(key)) === -1) { | ||
updatedScoring_1[key] = scoring.values[key]; | ||
} | ||
else { | ||
somethingWasRemoved_1 = true; | ||
wasSomethingRemovedFromAnyScope = true; | ||
} | ||
}); | ||
if (somethingWasRemoved_1) { | ||
this_1.writeScoring(currentScope, __assign(__assign({}, scoring), { values: updatedScoring_1 }), options === null || options === void 0 ? void 0 : options.quiet); | ||
if (!scoring) return [3 /*break*/, 3]; | ||
updatedScoring_1 = {}; | ||
somethingWasRemoved_1 = false; | ||
Object.keys(scoring.values).map(function (key) { | ||
if (intent && (intentsToRemove === null || intentsToRemove === void 0 ? void 0 : intentsToRemove.indexOf(key)) === -1) { | ||
updatedScoring_1[key] = scoring.values[key]; | ||
} | ||
else { | ||
somethingWasRemoved_1 = true; | ||
wasSomethingRemovedFromAnyScope = true; | ||
} | ||
}); | ||
if (!somethingWasRemoved_1) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, this_1.writeScoring(currentScope, __assign(__assign({}, scoring), { values: updatedScoring_1 }), options === null || options === void 0 ? void 0 : options.quiet)]; | ||
case 2: | ||
writtenScore = _a.sent(); | ||
if (!(options === null || options === void 0 ? void 0 : options.quiet)) { | ||
this_1.broadcastScoring(writtenScore === null || writtenScore === void 0 ? void 0 : writtenScore.values); | ||
} | ||
return [2 /*return*/]; | ||
_a.label = 3; | ||
case 3: return [2 /*return*/]; | ||
} | ||
@@ -954,2 +958,3 @@ }); | ||
scope: targetScope, | ||
quiet: options === null || options === void 0 ? void 0 : options.quiet, | ||
})]; | ||
@@ -956,0 +961,0 @@ case 2: |
{ | ||
"name": "@uniformdev/optimize-tracker", | ||
"version": "2.0.1-alpha.39+ea76e22", | ||
"version": "2.0.1-alpha.44+4b9892a", | ||
"description": "Uniform Optimize tracker", | ||
@@ -29,4 +29,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@uniformdev/optimize-common": "^2.0.1-alpha.39+ea76e22", | ||
"@uniformdev/optimize-tracker-common": "^2.0.1-alpha.39+ea76e22" | ||
"@uniformdev/optimize-common": "^2.0.1-alpha.44+4b9892a", | ||
"@uniformdev/optimize-tracker-common": "^2.0.1-alpha.44+4b9892a" | ||
}, | ||
@@ -56,3 +56,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "ea76e22933ec310afc7ab4a7041f2d8213adb8f9" | ||
"gitHead": "4b9892afd63257a4aaf8964670197554757bdbb6" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
259486
5350