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

telnet-client

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telnet-client - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

37

lib/index.js

@@ -223,3 +223,3 @@ 'use strict'

}
data += this.ors

@@ -356,31 +356,22 @@

this.response = this.inputBuffer.split(this.irs)
this.promptSameLine = false
for (let i = 0; i < this.response.length; i++) {
if (utils.search(this.response[i], this.pageSeparator) !== -1) {
this.response[i] = this.response[i].replace(this.pageSeparator, '')
if (this.response[i].length === 0) this.response.splice(i, 1)
let response = this.inputBuffer.split(this.irs)
for (let i = response.length - 1; i >= 0; --i) {
if (utils.search(response[i], this.pageSeparator) !== -1) {
response[i] = response[i].replace(this.pageSeparator, '')
if (response[i].length === 0)
response.splice(i, 1)
}
else if (this.response[i].indexOf(this.shellPrompt) !== -1)
this.promptSameLine = true
}
if (this.echoLines === 1) this.response.shift()
else if (this.echoLines > 1) this.response.splice(0, this.echoLines)
if (this.echoLines === 1) response.shift()
else if (this.echoLines > 1) response.splice(0, this.echoLines)
/* remove prompt */
if (this.stripShellPrompt) {
if (this.promptSameLine) {
if(this.response[this.response.length - 1])
this.response[this.response.length - 1] =
this.response[this.response.length - 1].replace(this.shellPrompt, '')
}
else {
this.response.pop()
/* add a blank line so that command output maintains the trailing new line */
this.response.push('')
}
const idx = response.length - 1;
response[idx] = utils.search(response[idx], this.shellPrompt) > -1
? response[idx].replace(this.shellPrompt, '')
: '';
}
this.response = response;

@@ -387,0 +378,0 @@ this.emit('responseready')

@@ -8,3 +8,3 @@ {

},
"version": "1.4.0",
"version": "1.4.1",
"main": "./lib/index.js",

@@ -11,0 +11,0 @@ "types": "./lib/index.d.ts",

@@ -1,2 +0,2 @@

var telnet = process.env.NODETELNETCLIENT_COV
var telnet = process.env.NODETELNETCLIENT_COV
? require('../lib-cov/index')

@@ -21,3 +21,3 @@ : require('../lib/index')

})
srv.listen(2323, function() {

@@ -40,3 +40,3 @@ callback()

port: 2323,
shellPrompt: /(>|])/,
shellPrompt: /[[<]\w+[>\]]/,
timeout: 1500

@@ -53,5 +53,5 @@ }

})
connection.connect(params)
},
})
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