@botmock-api/utils
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -67,7 +67,9 @@ "use strict"; | ||
var localCollected = collected; | ||
// iterate of all next messages; if message not found in intent map, | ||
var witnessedMessages = []; | ||
// iterate over all next messages; if message not found in intent map, | ||
// explore this message's next messages | ||
for (var _i = 0, next_1 = next; _i < next_1.length; _i++) { | ||
var message_id = next_1[_i].message_id; | ||
if (!map.has(message_id)) { | ||
witnessedMessages.push(message_id); | ||
if (!map.has(message_id) && !witnessedMessages.includes(message_id)) { | ||
var next_message_ids = getMessage(message_id).next_message_ids; | ||
@@ -74,0 +76,0 @@ localCollected = f(next_message_ids, collected.concat([message_id])); |
{ | ||
"name": "@botmock-api/utils", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "utilities for handling data from the Botmock API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -87,8 +87,10 @@ type Utterance = { | ||
export const createMessageCollector = <A, B>(map: IntentMap, getMessage: any) => | ||
function f(next: NextMessage[], collected: string[] = []) { | ||
function f(next: NextMessage[], collected: string[] = []): string[] { | ||
let localCollected = collected; | ||
// iterate of all next messages; if message not found in intent map, | ||
const witnessedMessages: string[] = []; | ||
// iterate over all next messages; if message not found in intent map, | ||
// explore this message's next messages | ||
for (const { message_id } of next) { | ||
if (!map.has(message_id)) { | ||
witnessedMessages.push(message_id); | ||
if (!map.has(message_id) && !witnessedMessages.includes(message_id)) { | ||
const { next_message_ids } = getMessage(message_id); | ||
@@ -95,0 +97,0 @@ localCollected = f(next_message_ids, [...collected, message_id]); |
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
16220
209