Socket
Socket
Sign inDemoInstall

@botmock-api/utils

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botmock-api/utils - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

17

index.js
// Return a map associating message id and array of intent ids connected to it
exports.createIntentMap = function createIntentMap(messages = []) {
exports.createIntentMap = (messages = []) => {
return new Map(

@@ -38,1 +38,16 @@ messages.reduce(

};
// Given an intent map and message-getting function, returns a function that finds
// reachable nodes that do not emanate intents
exports.getIntermediateNodes = (map, getMessage) =>
function f(next, collected = []) {
for (const { message_id } of next) {
// If the provided intent map does not have this message id, recur with
// this id appended to `collected`
if (!map.has(message_id)) {
const { next_message_ids } = getMessage(message_id);
return f(next_message_ids, [...collected, message_id]);
}
}
return collected;
};

2

package.json
{
"name": "@botmock-api/utils",
"version": "0.1.0",
"version": "0.2.0",
"description": "utilities for handling data from the Botmock API",

@@ -5,0 +5,0 @@ "main": "index.js",

# utils
```console
npm i @botmock/utils
npm i @botmock-api/utils
```
utilities for handling data from the Botmock API
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc