New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

callbag-combine

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-combine - npm Package Compare versions

Comparing version

to
1.0.1

readme.js

10

package.json
{
"name": "callbag-combine",
"version": "1.0.0",
"description":
"Callbag factory that combines data from multiple callbag sources",
"version": "1.0.1",
"description": "Callbag factory that combines data from multiple callbag sources",
"repository": {

@@ -10,3 +9,3 @@ "type": "git",

},
"main": "index.js",
"main": "readme.js",
"scripts": {

@@ -17,2 +16,5 @@ "test": "tape test.js"

"license": "MIT",
"keywords": [
"callbag"
],
"devDependencies": {

@@ -19,0 +21,0 @@ "tape": "^4.8.0"

88

test.js
const test = require('tape');
const combine = require('./index');
const combine = require('./readme');

@@ -7,6 +7,6 @@ test('it combines 1 async finite listenable source', (t) => {

const downwardsExpectedType = [
[0, 'function'],
[1, 'object'],
[1, 'object'],
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[2, 'undefined']

@@ -22,7 +22,7 @@ ];

i++;
sink(1, i);
if (i === 3) {
clearInterval(id);
sink(2);
}
sink(1, i);
if (i === 3) {
clearInterval(id);
sink(2);
}
}, 100);

@@ -56,12 +56,12 @@ sink(0, sourceA);

const downwardsExpectedType = [
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[2, 'undefined']
];
const downwardsExpected = [
[2, 'a'],
[2, 'a'],
[3, 'a'],

@@ -79,7 +79,7 @@ [4, 'a'],

i++;
sink(1, i);
if (i === 5) {
clearInterval(id);
sink(2);
}
sink(1, i);
if (i === 5) {
clearInterval(id);
sink(2);
}
}, 100);

@@ -126,6 +126,6 @@ sink(0, sourceA);

const downwardsExpectedType = [
[0, 'function'],
[1, 'object'],
[1, 'object'],
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
];

@@ -135,3 +135,3 @@ const downwardsExpected = [[10], [20], [30]];

function makeSource() {
let sent = 0;
let sent = 0;
let id;

@@ -143,7 +143,7 @@ const source = (type, data) => {

if (type === 0) {
const sink = data;
id = setInterval(() => {
const sink = data;
id = setInterval(() => {
sink(1, (++sent)*10);
}, 100);
sink(0, source);
}, 100);
sink(0, source);
} else if (type === 2) {

@@ -170,5 +170,5 @@ clearInterval(id);

if (downwardsExpected.length === 0) {
talkback(2);
talkback(2);
}
};
};
}

@@ -198,11 +198,11 @@

const downwardsExpectedType = [
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object']
[0, 'function'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object'],
[1, 'object']
];
const downwardsExpected = [
[2, 'a'],
[2, 'a'],
[3, 'a'],

@@ -242,9 +242,9 @@ [4, 'a'],

id = setTimeout(() => {
sink(1, 'a');
sink(1, 'a');
id = setTimeout(() => {
sink(1, 'b');
sink(1, 'b');
id = setTimeout(() => {
sink(1, 'c');
sink(1, 'c');
id = setTimeout(() => {
sink(1, 'd');
sink(1, 'd');
}, 230);

@@ -278,5 +278,5 @@ }, 230);

if (downwardsExpected.length === 0) {
talkback(2);
talkback(2);
}
};
};
}

@@ -283,0 +283,0 @@