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

wonka

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wonka - npm Package Compare versions

Comparing version 6.1.1 to 6.1.2

1

dist/wonka.js

@@ -1147,2 +1147,3 @@ Object.defineProperty(exports, "__esModule", {

f = !0;
a(1);
s(1);

@@ -1149,0 +1150,0 @@ i(0);

2

package.json
{
"name": "wonka",
"description": "A tiny but capable push & pull stream library for TypeScript and Flow",
"version": "6.1.1",
"version": "6.1.2",
"author": "0no.co <hi@0no.co>",

@@ -6,0 +6,0 @@ "source": "./src/index.ts",

@@ -509,2 +509,28 @@ import { describe, it, expect, beforeEach, vi } from 'vitest';

});
it('completes the source when no more sink is listening', () => {
let onPush = () => {};
const talkback = vi.fn();
const source: Source<any> = operators.share(sink => {
sink(start(talkback));
onPush = () => {
sink(push([0]));
sink(push([1]));
sink(SignalKind.End);
};
});
const fnA = vi.fn();
const fnB = vi.fn();
sinks.forEach(fnA)(operators.take(1)(source));
sinks.forEach(fnB)(operators.take(1)(source));
onPush();
expect(fnA).toHaveBeenCalledWith([0]);
expect(fnB).toHaveBeenCalledWith([0]);
expect(fnA.mock.calls[0][0]).toBe(fnB.mock.calls[0][0]);
expect(talkback).toHaveBeenCalledWith(TalkbackKind.Close);
});
});

@@ -701,2 +727,28 @@

});
it('emits values until a notifier emits', () => {
const { source: input$, next } = sources.makeSubject<number>();
const fn = vi.fn();
let hasClosed = false;
operators.takeUntil(sink => {
sink(
start(talkback => {
if (talkback === TalkbackKind.Close) {
hasClosed = true;
} else if (talkback === TalkbackKind.Pull && !hasClosed) {
sink(push(1));
}
})
);
})(input$)(fn);
next(1);
expect(fn).toHaveBeenCalledTimes(2);
expect(fn.mock.calls).toEqual([[0], [start(expect.any(Function))]]);
expect(hasClosed).toBe(true);
});
});

@@ -703,0 +755,0 @@

@@ -713,2 +713,3 @@ import { Source, Sink, Operator, SignalKind, TalkbackKind, TalkbackFn } from './types';

ended = true;
notifierTalkback(TalkbackKind.Close);
sourceTalkback(TalkbackKind.Close);

@@ -715,0 +716,0 @@ sink(SignalKind.End);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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