utils
npm i @botmock-api/utils
utilities for handling data from the Botmock API
API
import * as utils from '@botmock-api/utils';
enumeratePaths
utils.enumeratePaths(messages: Message[]): Set<Array<string>>
Function that returns a Set
which contains arrays with the message ids of each possible journey in the provided messages
createIntentMap
utils.createIntentMap(messages: []): Map<messageId: string, intentIds: string[]>
Function that returns a Map
which associates message ids with the list of intent ids connected to them
createNodeCollector
utils.createNodeCollector(map: Map, get: (id: string) => ({}): (arr: string[]) => string[]
Creates function that turns next_messages
into a collection of all reachable
messages that are not connected by an intent