@openreplay/tracker
Advanced tools
Comparing version 3.3.0 to 3.3.1
@@ -20,3 +20,3 @@ "use strict"; | ||
this.isActive = false; | ||
this.version = '3.3.0'; | ||
this.version = '3.3.1'; | ||
this.projectKey = projectKey; | ||
@@ -23,0 +23,0 @@ this.options = Object.assign({ |
@@ -111,3 +111,3 @@ "use strict"; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.3.0', | ||
trackerVersion: '3.3.1', | ||
projectKey: options.projectKey, | ||
@@ -114,0 +114,0 @@ doNotTrack, |
@@ -218,11 +218,13 @@ "use strict"; | ||
} | ||
function* combinations(stack, path = []) { | ||
function combinations(stack, path = []) { | ||
const paths = []; | ||
if (stack.length > 0) { | ||
for (let node of stack[0]) { | ||
yield* combinations(stack.slice(1, stack.length), path.concat(node)); | ||
paths.push(...combinations(stack.slice(1, stack.length), path.concat(node))); | ||
} | ||
} | ||
else { | ||
yield path; | ||
paths.push(path); | ||
} | ||
return paths; | ||
} | ||
@@ -232,10 +234,11 @@ function sort(paths) { | ||
} | ||
function* optimize(path, input, scope = { | ||
function optimize(path, input, scope = { | ||
counter: 0, | ||
visited: new Map() | ||
}) { | ||
const paths = []; | ||
if (path.length > 2 && path.length > config.optimizedMinLength) { | ||
for (let i = 1; i < path.length - 1; i++) { | ||
if (scope.counter > config.maxNumberOfTries) { | ||
return; // Okay At least I tried! | ||
return paths; // Okay At least I tried! | ||
} | ||
@@ -247,11 +250,12 @@ scope.counter += 1; | ||
if (scope.visited.has(newPathKey)) { | ||
return; | ||
return paths; | ||
} | ||
if (unique(newPath) && same(newPath, input)) { | ||
yield newPath; | ||
paths.push(newPath); | ||
scope.visited.set(newPathKey, true); | ||
yield* optimize(newPath, input, scope); | ||
paths.push(...optimize(newPath, input, scope)); | ||
} | ||
} | ||
} | ||
return paths; | ||
} | ||
@@ -258,0 +262,0 @@ function same(path, input) { |
@@ -17,3 +17,3 @@ import { timestamp, log } from '../utils'; | ||
this.isActive = false; | ||
this.version = '3.3.0'; | ||
this.version = '3.3.1'; | ||
this.projectKey = projectKey; | ||
@@ -20,0 +20,0 @@ this.options = Object.assign({ |
@@ -107,3 +107,3 @@ import App, { DEFAULT_INGEST_POINT } from './app'; | ||
req.send(JSON.stringify({ | ||
trackerVersion: '3.3.0', | ||
trackerVersion: '3.3.1', | ||
projectKey: options.projectKey, | ||
@@ -110,0 +110,0 @@ doNotTrack, |
@@ -214,11 +214,13 @@ var Limit; | ||
} | ||
function* combinations(stack, path = []) { | ||
function combinations(stack, path = []) { | ||
const paths = []; | ||
if (stack.length > 0) { | ||
for (let node of stack[0]) { | ||
yield* combinations(stack.slice(1, stack.length), path.concat(node)); | ||
paths.push(...combinations(stack.slice(1, stack.length), path.concat(node))); | ||
} | ||
} | ||
else { | ||
yield path; | ||
paths.push(path); | ||
} | ||
return paths; | ||
} | ||
@@ -228,10 +230,11 @@ function sort(paths) { | ||
} | ||
function* optimize(path, input, scope = { | ||
function optimize(path, input, scope = { | ||
counter: 0, | ||
visited: new Map() | ||
}) { | ||
const paths = []; | ||
if (path.length > 2 && path.length > config.optimizedMinLength) { | ||
for (let i = 1; i < path.length - 1; i++) { | ||
if (scope.counter > config.maxNumberOfTries) { | ||
return; // Okay At least I tried! | ||
return paths; // Okay At least I tried! | ||
} | ||
@@ -243,11 +246,12 @@ scope.counter += 1; | ||
if (scope.visited.has(newPathKey)) { | ||
return; | ||
return paths; | ||
} | ||
if (unique(newPath) && same(newPath, input)) { | ||
yield newPath; | ||
paths.push(newPath); | ||
scope.visited.set(newPathKey, true); | ||
yield* optimize(newPath, input, scope); | ||
paths.push(...optimize(newPath, input, scope)); | ||
} | ||
} | ||
} | ||
return paths; | ||
} | ||
@@ -254,0 +258,0 @@ function same(path, input) { |
{ | ||
"name": "@openreplay/tracker", | ||
"description": "The OpenReplay tracker main package", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "logging", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309200
7726