@uniformdev/optimize-tracker
Advanced tools
Comparing version 2.0.1-alpha.35 to 2.0.1-alpha.39
@@ -10,3 +10,3 @@ "use strict"; | ||
personalization: function (_a) { | ||
var matches = _a.matches, includedInTest = _a.includedInTest; | ||
var matches = _a.matches, includedInTest = _a.includedInTest, intentScores = _a.intentScores; | ||
if (!tracker || !tracker.isInitialized()) { | ||
@@ -20,2 +20,3 @@ return false; | ||
value: includedInTest, | ||
intentScores: intentScores, | ||
}); | ||
@@ -22,0 +23,0 @@ return true; |
@@ -168,2 +168,3 @@ "use strict"; | ||
isIncludedInTest: isIncludedInTest, | ||
intentScores: intentScores, | ||
}); | ||
@@ -170,0 +171,0 @@ var result = scoredItems; |
@@ -49,9 +49,2 @@ "use strict"; | ||
}; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -392,27 +385,18 @@ exports.OptimizeTracker = void 0; | ||
evaluationResults.forEach(function (evaluationResult) { | ||
var _a; | ||
var signal = evaluationResult.signal, scope = evaluationResult.scope, result = evaluationResult.result, intent = evaluationResult.intent; | ||
var id = intent.id; | ||
if (scope && result && (result.strength || result.strength === optimize_common_1.IntentTagStrength.Antimatter)) { | ||
var _b = summary[scope.type] || { | ||
var _a = (summary[scope.type] = summary[scope.type] || { | ||
matches: [], | ||
score: {}, | ||
}, score = _b.score, matches = _b.matches; | ||
var str = (score[id] || { | ||
}), score = _a.score, matches = _a.matches; | ||
var scopeScore = (score[id] = score[id] || { | ||
str: 0, | ||
}).str; | ||
summary[scope.type] = { | ||
score: (_a = {}, | ||
_a[id] = { | ||
str: Number(str) + Number(result.strength), | ||
}, | ||
_a), | ||
matches: __spreadArrays([ | ||
{ | ||
intentId: id, | ||
signalStrength: result.strength, | ||
signalType: signal.type, | ||
} | ||
], matches), | ||
}; | ||
}); | ||
scopeScore.str = Number(scopeScore.str) + Number(result.strength); | ||
matches.push({ | ||
intentId: id, | ||
signalStrength: result.strength, | ||
signalType: signal.type, | ||
}); | ||
} | ||
@@ -419,0 +403,0 @@ }); |
@@ -7,3 +7,3 @@ export var AnalyticsEmitter = function (_a) { | ||
personalization: function (_a) { | ||
var matches = _a.matches, includedInTest = _a.includedInTest; | ||
var matches = _a.matches, includedInTest = _a.includedInTest, intentScores = _a.intentScores; | ||
if (!tracker || !tracker.isInitialized()) { | ||
@@ -17,2 +17,3 @@ return false; | ||
value: includedInTest, | ||
intentScores: intentScores, | ||
}); | ||
@@ -19,0 +20,0 @@ return true; |
@@ -162,2 +162,3 @@ var __assign = (this && this.__assign) || function () { | ||
isIncludedInTest: isIncludedInTest, | ||
intentScores: intentScores, | ||
}); | ||
@@ -164,0 +165,0 @@ var result = scoredItems; |
@@ -48,9 +48,2 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
import { IntentTagStrength, Scope, SignalFrequency, } from '@uniformdev/optimize-common'; | ||
@@ -389,27 +382,18 @@ import { decayByDayStrategy } from './decay/decayByDayStrategy'; | ||
evaluationResults.forEach(function (evaluationResult) { | ||
var _a; | ||
var signal = evaluationResult.signal, scope = evaluationResult.scope, result = evaluationResult.result, intent = evaluationResult.intent; | ||
var id = intent.id; | ||
if (scope && result && (result.strength || result.strength === IntentTagStrength.Antimatter)) { | ||
var _b = summary[scope.type] || { | ||
var _a = (summary[scope.type] = summary[scope.type] || { | ||
matches: [], | ||
score: {}, | ||
}, score = _b.score, matches = _b.matches; | ||
var str = (score[id] || { | ||
}), score = _a.score, matches = _a.matches; | ||
var scopeScore = (score[id] = score[id] || { | ||
str: 0, | ||
}).str; | ||
summary[scope.type] = { | ||
score: (_a = {}, | ||
_a[id] = { | ||
str: Number(str) + Number(result.strength), | ||
}, | ||
_a), | ||
matches: __spreadArrays([ | ||
{ | ||
intentId: id, | ||
signalStrength: result.strength, | ||
signalType: signal.type, | ||
} | ||
], matches), | ||
}; | ||
}); | ||
scopeScore.str = Number(scopeScore.str) + Number(result.strength); | ||
matches.push({ | ||
intentId: id, | ||
signalStrength: result.strength, | ||
signalType: signal.type, | ||
}); | ||
} | ||
@@ -416,0 +400,0 @@ }); |
{ | ||
"name": "@uniformdev/optimize-tracker", | ||
"version": "2.0.1-alpha.35+9771b51", | ||
"version": "2.0.1-alpha.39+ea76e22", | ||
"description": "Uniform Optimize tracker", | ||
@@ -29,4 +29,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@uniformdev/optimize-common": "^2.0.1-alpha.35+9771b51", | ||
"@uniformdev/optimize-tracker-common": "^2.0.1-alpha.35+9771b51" | ||
"@uniformdev/optimize-common": "^2.0.1-alpha.39+ea76e22", | ||
"@uniformdev/optimize-tracker-common": "^2.0.1-alpha.39+ea76e22" | ||
}, | ||
@@ -56,3 +56,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "9771b516ca4e9197d234d0d2a7c16669443d4c46" | ||
"gitHead": "ea76e22933ec310afc7ab4a7041f2d8213adb8f9" | ||
} |
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
258848
5342