Skip to content

Commit

Permalink
Update bare-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed May 31, 2024
1 parent d82dc46 commit d2b4065
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const constants = exports.constants = {

const Socket = exports.Socket = class NetSocket extends Duplex {
constructor (opts = {}) {
super({ mapWritable, eagerOpen: true })
super({ eagerOpen: true })

const {
readBufferSize = defaultReadBufferSize,
Expand Down Expand Up @@ -105,7 +105,7 @@ const Socket = exports.Socket = class NetSocket extends Duplex {
return this
}

_write (data, cb) {
_write (data, encoding, cb) {
if (this._socket !== null && this._socket.write(data)) cb(null)
else this._pendingWrite = cb
}
Expand Down Expand Up @@ -316,7 +316,3 @@ exports.createConnection = function createConnection (...args) {
exports.createServer = function createServer (opts, onconnection) {
return new Server(opts, onconnection)
}

function mapWritable (buf) {
return typeof buf === 'string' ? Buffer.from(buf) : buf
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"bare-events": "^2.2.2",
"bare-pipe": "^3.2.0",
"bare-stream": "^1.0.0",
"bare-stream": "^2.0.0",
"bare-tcp": "^1.4.0"
},
"devDependencies": {
Expand Down

0 comments on commit d2b4065

Please sign in to comment.