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

nock

Package Overview
Dependencies
Maintainers
3
Versions
431
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nock - npm Package Compare versions

Comparing version 12.0.2 to 12.0.3

22

lib/intercepted_request_router.js

@@ -145,2 +145,3 @@ 'use strict'

// handle the different overloaded param signatures
if (typeof chunk === 'function') {

@@ -154,11 +155,9 @@ callback = chunk

if (typeof callback === 'function') {
req.once('finish', callback)
}
if (!req.aborted && !this.playbackStarted) {
req.write(chunk, encoding, () => {
if (typeof callback === 'function') {
callback()
}
this.startPlayback()
req.emit('finish')
req.emit('end')
})
req.write(chunk, encoding)
this.startPlayback()
}

@@ -168,2 +167,4 @@ if (req.aborted) {

}
return req
}

@@ -277,2 +278,7 @@

// wait to emit the finish event until we know for sure an Interceptor is going to playback.
// otherwise an unmocked request might emit finish twice.
req.finished = true
req.emit('finish')
playbackInterceptor({

@@ -279,0 +285,0 @@ req,

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

/**
* Play back an intercepto using the given request and mock response.
* Play back an interceptor using the given request and mock response.
*/

@@ -78,0 +78,0 @@ function playbackInterceptor({

@@ -16,2 +16,3 @@ 'use strict'

this.bufferSize = 0
this.writableLength = 0
this.writable = true

@@ -18,0 +19,0 @@ this.readable = true

@@ -10,3 +10,3 @@ {

],
"version": "12.0.2",
"version": "12.0.3",
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",

@@ -13,0 +13,0 @@ "repository": {

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