extension-port-stream
Advanced tools
Comparing version 4.1.0 to 4.2.0
/// <reference types="node" /> | ||
import { Duplex } from 'readable-stream'; | ||
import { Duplex, DuplexOptions } from 'readable-stream'; | ||
import type { Runtime } from 'webextension-polyfill'; | ||
@@ -11,4 +11,5 @@ declare type Log = (data: unknown, out: boolean) => void; | ||
* {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port} | ||
* @param streamOptions - stream options passed on to Duplex stream constructor | ||
*/ | ||
constructor(port: Runtime.Port); | ||
constructor(port: Runtime.Port, streamOptions?: DuplexOptions); | ||
/** | ||
@@ -15,0 +16,0 @@ * Callback triggered when a message is received from |
@@ -9,5 +9,6 @@ "use strict"; | ||
* {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port} | ||
* @param streamOptions - stream options passed on to Duplex stream constructor | ||
*/ | ||
constructor(port) { | ||
super({ objectMode: true }); | ||
constructor(port, streamOptions = {}) { | ||
super(Object.assign({ objectMode: true }, streamOptions)); | ||
this._port = port; | ||
@@ -14,0 +15,0 @@ this._port.onMessage.addListener((msg) => this._onMessage(msg)); |
{ | ||
"name": "extension-port-stream", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "A module for creating a node style stream over a WebExtension port object.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8693
128