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

fraight-bot-client

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fraight-bot-client - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

20

index.js

@@ -7,3 +7,3 @@ const express = require('express');

constructor(params) {
constructor(params = { delay: 1000 }) {
this.params = params;

@@ -26,2 +26,3 @@ this.setupServer();

headers: this.headers,
delay: this.params.delay
});

@@ -103,2 +104,3 @@ next();

constructor({ botThread, message, headers, host}) {
this.seen_at = Date.now();
Object.assign(this, botThread);

@@ -110,2 +112,10 @@ this.commands = [];

get timeToSend() {
const toWait = this.delay - (Date.now() - this.seen_at);
if (toWait < 0) {
return 0;
}
return toWait;
}
get requestOptions() {

@@ -174,4 +184,10 @@ return {

async exec() {
return axios(this.requestOptions);
return new Promise((resolve, reject) => {
setTimeout(() =>
axios(this.requestOptions)
.then(resolve)
.catch(reject),
this.toWait);
})
}
}

2

package.json
{
"name": "fraight-bot-client",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

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

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