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 1.0.5 to 1.0.7

dist/index.js

2

__tests__/index.ts

@@ -0,1 +1,3 @@

// import { createIntentMap } from "../src";
test.todo("..");

13

package.json
{
"name": "@botmock-api/utils",
"version": "1.0.5",
"version": "1.0.7",
"description": "utilities for handling data from the Botmock API",
"main": "index.js",
"types": "index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "jest",
"build": "babel --out-file index.js src/index.ts"
"build": "tsc ./src/index.ts --outDir dist/",
"prepublishOnly": "tsc ./src/index.ts --outDir dist/"
},

@@ -35,8 +36,4 @@ "keywords": [

"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/preset-typescript": "7.3.3",
"@types/jest": "24.0.15",
"@types/node": "12.0.8",
"@types/node-fetch": "2.3.7",
"jest": "24.8.0",

@@ -43,0 +40,0 @@ "ts-jest": "^24.0.2",

@@ -0,9 +1,21 @@

type Utterance = {
text: string;
variables: any[];
};
type Intent = {
id: string;
name: string;
utterances: {}[];
utterances: Utterance[];
};
type NextMessage = {
message_id: string;
action: any;
conditional: boolean;
intent: { value: string };
};
type Message = {
next_message_ids: { message_id: string; intent: { value: string } }[];
next_message_ids: NextMessage[];
};

@@ -30,7 +42,7 @@

return new Map<string, Intent[]>(
messages.reduce(
(acc, { next_message_ids }) => [
messages.reduce((acc, { next_message_ids }) => {
return [
...acc,
...next_message_ids
.filter(({ intent }) => intent.value)
.filter(({ intent = { value: "" } }) => intent.value)
.map(message => [

@@ -58,6 +70,5 @@ message.message_id,

])
],
[]
)
];
}, [])
);
};
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es2017", "es7", "es6"],
"outDir": "dist",
"declaration": true,
"sourceMap": true,
"allowJs": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"checkJs": true,
"lib": ["esnext"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"preserveConstEnums": true,
"pretty": true,
"removeComments": true,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"esModuleInterop": true
"target": "esnext",
"types": []
},
"exclude": ["node_modules", "dist"]
}
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