Socket
Socket
Sign inDemoInstall

split2

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split2 - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

index.js

@@ -24,2 +24,5 @@ /*

this._last += this._decoder.write(chunk)
if (this._last.length > this.maxLength) {
return cb(new Error('maximum buffer reached'))
}

@@ -100,2 +103,3 @@ var list = this._last.split(this.matcher)

stream.mapper = mapper
stream.maxLength = options.maxLength

@@ -102,0 +106,0 @@ return stream

4

package.json
{
"name": "split2",
"version": "2.0.1",
"version": "2.1.0",
"description": "split a Text Stream into a Line Stream, using Stream 3",

@@ -26,3 +26,3 @@ "main": "index.js",

"pre-commit": "^1.1.2",
"standard": "^5.4.1",
"standard": "^7.0.0",
"tap": "^5.0.0"

@@ -29,0 +29,0 @@ },

@@ -29,2 +29,5 @@ # Split2(matcher, mapper, options)

Additionally, the `.maxLength` option is implemented, which will make the split stream throw an error
if the buffer size exceeds `.maxLength`.
Calling `.destroy` will make the stream emit `close`. Use this to perform cleanup logic

@@ -31,0 +34,0 @@

@@ -286,1 +286,14 @@ 'use strict'

})
test('maximum buffer limit', function (t) {
t.plan(1)
var input = split({ maxLength: 2 })
input.pipe(strcb(function (err, list) {
t.ok(err)
}))
input.write('hey')
})

Sorry, the diff of this file is not supported yet

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