Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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.2.0 to 0.3.0

11

__tests__/index.js

@@ -1,5 +0,12 @@

const { createIntentMap } = require('../');
const { createIntentMap, createNodeCollector } = require('../');
test('returns a Map', () => {
test('`createIntentMap` returns a map', () => {
expect(createIntentMap()).toEqual(new Map());
});
test('`createNodeCollector` returns a function', () => {
expect(() => {
createNodeCollector();
}).not.toThrow();
expect(createNodeCollector() instanceof Function).toBeTruthy();
});

4

index.js

@@ -39,5 +39,3 @@ // Return a map associating message id and array of intent ids connected to it

// Given an intent map and message-getting function, returns a function that finds
// reachable nodes that do not emanate intents
exports.getIntermediateNodes = (map, getMessage) =>
exports.createNodeCollector = (map, getMessage) =>
function f(next, collected = []) {

@@ -44,0 +42,0 @@ for (const { message_id } of next) {

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

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

# utils
```console
```
npm i @botmock-api/utils

@@ -8,1 +8,17 @@ ```

utilities for handling data from the Botmock API
### API
```
import * as utils from '@botmock-api/utils';
```
#### `utils.createIntentMap(messages: []): Map<messageId: string, intentIds: string[]>`
Function that returns a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
which associates message ids with the list of intent ids connected to them
#### `utils.createNodeCollector(map: Map, getter: (id: string) => Object): (next: string[]) => string[]`
Creates function that turns `next_messages` into a collection of _all_ reachable
messages that are not connected by an intent
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