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

through2-map

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

through2-map - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

.nyc_output/12423.json

8

index.js

@@ -19,4 +19,8 @@ "use strict";

if (this.options.wantStrings) chunk = chunk.toString()
this.push(fn.call(this, chunk, this._index++))
return callback()
try {
this.push(fn.call(this, chunk, this._index++))
return callback()
} catch (e) {
return callback(e)
}
})

@@ -23,0 +27,0 @@ Map.prototype._index = 0

{
"name": "through2-map",
"version": "2.0.0",
"version": "3.0.0",
"description": "A through2 to create an Array.prototype.map analog for streams.",

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

@@ -199,1 +199,27 @@ "use strict";

})
test("error", function (t) {
t.plan(1)
var f = map(function (chunk) {
throw new Error("Error in map function")
})
function end () {
t.fail("Should not end")
}
var r = spigot([
"a",
"b",
"cdefghijk",
"lmnopqrst",
"u",
"vwxyz",
]).pipe(f)
.on("end", end)
.on("error", function (err) {
t.true(err instanceof Error, "Caught error")
})
})
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