🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

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

to
4.2.0

2

index.js

@@ -98,3 +98,3 @@ /*

// If options is only argument.
} else if (typeof matcher === 'object' && !(matcher instanceof RegExp)) {
} else if (typeof matcher === 'object' && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
options = matcher

@@ -101,0 +101,0 @@ matcher = /\r?\n/

{
"name": "split2",
"version": "4.1.0",
"version": "4.2.0",
"description": "split a Text Stream into a Line Stream, using Stream 3",

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

"pre-commit": "^1.1.2",
"standard": "^16.0.1",
"standard": "^17.0.0",
"tape": "^5.0.0"
}
}

@@ -63,3 +63,3 @@ # Split2(matcher, mapper, options)

})
.on("error", function(error) => {
.on("error", function(error) {
//handling parsing errors

@@ -66,0 +66,0 @@ })

@@ -393,1 +393,18 @@ 'use strict'

})
test('supports Symbol.split', function (t) {
t.plan(2)
const input = split({
[Symbol.split] (str) {
return str.split('~')
}
})
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})