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

callbag-start-with

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-start-with - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

6

package.json
{
"name": "callbag-start-with",
"version": "2.1.0",
"version": "2.1.1",
"description": "Callbag operator that seeds a source with an initial data output",

@@ -19,7 +19,7 @@ "repository": {

"devDependencies": {
"callbag-for-each": "~1.0.1",
"callbag-from-iter": "~1.0.0",
"callbag-for-each": "~1.0.1",
"callbag-mock": "^1.0.0",
"callbag-mock": "^2.1.0",
"tape": "^4.8.0"
}
}

@@ -8,8 +8,5 @@ const test = require('tape');

test('it seeds the source with initial value, then passes the rest on down', t => {
let history = [];
const report = (name,dir,t,d) => t !== 0 && d !== undefined && history.push([name,dir,t,d]);
const source = makeMockCallbag('source', true);
const source = makeMockCallbag(true);
const seedWithFoo = startWith('foo');
const sink = makeMockCallbag('sink', report);
const sink = makeMockCallbag();

@@ -22,9 +19,8 @@ seedWithFoo(source)(0, sink);

t.deepEqual(history, [
['sink', 'body', 1, 'foo'],
['sink', 'body', 1, 'bar'],
['sink', 'body', 1, 'baz'],
['sink', 'body', 2, 'error'],
], 'sink gets seed and subsequent data');
t.deepEqual(
sink.getReceivedData(),
['foo','bar','baz'],
'sink gets seed and subsequent data'
);
t.ok(!sink.checkConnection(), 'sink gets termination');
t.end();

@@ -35,7 +31,7 @@ });

let history = [];
const report = (name,dir,t,d) => t !== 0 && history.push([name,dir,t,d]);
const report = (t,d) => t !== 0 && history.push([t,d]);
const source = makeMockCallbag('source', report, true);
const source = makeMockCallbag(report, true);
const seedWithFoo = startWith('foo');
const sink = makeMockCallbag('sink', report);
const sink = makeMockCallbag();

@@ -48,5 +44,4 @@ seedWithFoo(source)(0, sink);

t.deepEqual(history, [
['sink', 'body', 1, 'foo'],
['source', 'talkback', 1, undefined],
['source', 'talkback', 2, undefined],
[1, undefined],
[2, undefined],
], 'source gets requests from sink');

@@ -72,8 +67,5 @@

test('it supports multiple arguments', t => {
let history = [];
const report = (name,dir,t,d) => t !== 0 && d !== undefined && history.push([name,dir,t,d]);
const source = makeMockCallbag('source', true);
const source = makeMockCallbag(true);
const seedWithMultipleEmits = startWith('foo', 'bar', 'baz');
const sink = makeMockCallbag('sink', report);
const sink = makeMockCallbag();

@@ -83,13 +75,10 @@ seedWithMultipleEmits(source)(0, sink);

source.emit(1, 'qu');
source.emit(2, 'error');
t.deepEqual(history, [
['sink', 'body', 1, 'foo'],
['sink', 'body', 1, 'bar'],
['sink', 'body', 1, 'baz'],
['sink', 'body', 1, 'qu'],
['sink', 'body', 2, 'error'],
], 'sink gets seed and subsequent data');
t.deepEqual(
sink.getReceivedData(),
['foo','bar','baz','qu'],
'sink gets seed and subsequent data'
);
t.end();
});
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