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

debounce-stream

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debounce-stream - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

28

index.js

@@ -18,4 +18,4 @@ var Transform = require("stream").Transform;

// Track the reference retruned by setTimeout
var timeout = null;
// Track the reference returned by setTimeout
var timeoutId = null;

@@ -39,11 +39,11 @@ // Whether the state is paused or not

// If paused just ignore outputting it for now
if (paused) callback();
else {
// If we aren't paused, say that there is no value
has_value = false;
// Pause
pause();
// Pass the data down the stream
callback(null, last_value);
}
if (paused) return callback();
// If we aren't paused, say that there is no value
has_value = false;
// Pause
pause();
// Pass the data down the stream
callback(null, last_value);
}

@@ -53,3 +53,3 @@

stream._flush = function (callback) {
clearTimeout(timeout);
clearTimeout(timeoutId);
if (has_value) this.push(last_value);

@@ -64,5 +64,5 @@ callback();

// Clear any previous timeout, just in case
clearTimeout(timeout);
clearTimeout(timeoutId);
// Set a new timeout to unpause after the given interval
timeout = setTimeout(unpause, interval);
timeoutId = setTimeout(unpause, interval);
}

@@ -69,0 +69,0 @@

{
"name": "debounce-stream",
"version": "1.0.0",
"version": "1.0.1",
"description": "A stream that only forwards input once in a given interval",

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

@@ -26,3 +26,3 @@ # debounce-stream

``` javascript
var DebounceStream = require("../");
var DebounceStream = require("debounce-stream");
var IntervalStream = require("interval-stream");

@@ -29,0 +29,0 @@ var StreamArray = require("stream-array");

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