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

it-goodbye

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-goodbye - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

dist/src/index.d.ts
import type { Duplex } from 'it-stream-types';
export declare function goodbye(stream: Duplex<Uint8Array, Uint8Array>, goodbye?: Uint8Array | string): Duplex<Uint8Array, Uint8Array, Promise<void>>;
export declare function goodbye<TSinkReturn>(stream: Duplex<Uint8Array, Uint8Array, Promise<TSinkReturn>>, goodbye?: Uint8Array | string): Duplex<Uint8Array, Uint8Array, Promise<TSinkReturn>>;
//# sourceMappingURL=index.d.ts.map
{
"name": "it-goodbye",
"description": "Add a goodbye handshake to a duplex async iterable",
"version": "4.0.0",
"version": "4.0.1",
"type": "module",

@@ -111,3 +111,3 @@ "types": "./dist/src/index.d.ts",

"test": "aegir test -f ./dist/test",
"test:chrome": "npm run test -- -t browser",
"test:chrome": "npm run test -- -t browser --cov",
"test:chrome-webworker": "npm run test -- -t webworker",

@@ -137,4 +137,3 @@ "test:firefox": "npm run test -- -t browser -- --browser firefox",

"muxrpc": "^6.4.2",
"pull-stream": "^3.6.9",
"streaming-iterables": "^6.0.0"
"pull-stream": "^3.6.9"
},

@@ -141,0 +140,0 @@ "author": "Alan Shaw",

import { endable } from './endable.js'
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import type { Duplex } from 'it-stream-types'
import type { Duplex, Source } from 'it-stream-types'
export function goodbye (stream: Duplex<Uint8Array, Uint8Array>, goodbye?: Uint8Array | string) {
export function goodbye <TSinkReturn> (stream: Duplex<Uint8Array, Uint8Array, Promise<TSinkReturn>>, goodbye?: Uint8Array | string) {
let token: Uint8Array

@@ -19,3 +19,3 @@

const output: Duplex<Uint8Array, Uint8Array, Promise<void>> = {
const output: Duplex<Uint8Array, Uint8Array, Promise<TSinkReturn>> = {
// when the source ends,

@@ -25,3 +25,3 @@ // send the goodbye and then wait to receive

source: e(stream.source),
sink: async source => {
sink: async (source: Source<Uint8Array>): Promise<TSinkReturn> => {
return await stream.sink(async function * () {

@@ -28,0 +28,0 @@ // when the goodbye is received, allow the source to end.

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