Socket
Socket
Sign inDemoInstall

peek-readable

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peek-readable - npm Package Compare versions

Comparing version 5.0.0-alpha.3 to 5.0.0-alpha.4

10

lib/index.js

@@ -5,2 +5,4 @@ import { EndOfStreamError } from './EndOfFileStream.js';

constructor() {
this.resolve = () => null;
this.reject = () => null;
this.promise = new Promise((resolve, reject) => {

@@ -16,2 +18,6 @@ this.reject = reject;

this.s = s;
/**
* Deferred read request
*/
this.request = null;
this.endOfStream = false;

@@ -61,2 +67,4 @@ /**

const peekData = this.peekQueue.pop(); // Front of queue
if (!peekData)
throw new Error('peekData should be defined');
const lenCopy = Math.min(peekData.length, remaining);

@@ -111,2 +119,4 @@ buffer.set(peekData.subarray(0, lenCopy), offset + bytesRead);

tryRead() {
if (!this.request)
throw new Error('this.request should be defined');
const readBuffer = this.s.read(this.request.length);

@@ -113,0 +123,0 @@ if (readBuffer) {

11

package.json
{
"name": "peek-readable",
"version": "5.0.0-alpha.3",
"version": "5.0.0-alpha.4",
"description": "Read and peek from a readable stream",

@@ -28,3 +28,3 @@ "author": {

"engines": {
"node": ">=12.20"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -48,6 +48,7 @@ "repository": {

"devDependencies": {
"@types/chai": "^4.2.21",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.6",
"@types/node": "^16.4.10",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.3",
"@typescript-eslint/parser": "^4.28.5",
"add": "^2.0.6",

@@ -58,3 +59,3 @@ "c8": "^7.8.0",

"del-cli": "^4.0.1",
"eslint": "^7.30.0",
"eslint": "^7.32.0",
"mocha": "^9.0.3",

@@ -61,0 +62,0 @@ "remark-cli": "^9.0.0",

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