You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@saulx/utils

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saulx/utils - npm Package Compare versions

Comparing version

to
4.3.2

2

dist/src/readStream.d.ts

@@ -5,3 +5,3 @@ /// <reference types="node" resolution-mode="require"/>

throttle?: number;
maxCunkSize?: number;
maxChunkSize?: number;
}) => Promise<Buffer>;
import { Writable } from 'stream';
export const readStream = (stream, opts) => new Promise((resolve, reject) => {
const maxCunkSize = opts?.maxCunkSize ?? 0;
const maxChunkSize = opts?.maxChunkSize ?? 0;
const throttle = opts?.throttle ?? 0;
const buffers = [];
const processChunk = (c, next) => {
buffers.push(c.slice(0, maxCunkSize));
const chunkP = c.slice(maxCunkSize, c.byteLength);
if (chunkP.byteLength > maxCunkSize) {
buffers.push(c.slice(0, maxChunkSize));
const chunkP = c.slice(maxChunkSize, c.byteLength);
if (chunkP.byteLength > maxChunkSize) {
if (throttle) {

@@ -33,3 +33,3 @@ setTimeout(() => {

write: (c, _encoding, next) => {
if (maxCunkSize && c.byteLength > maxCunkSize) {
if (maxChunkSize && c.byteLength > maxChunkSize) {
processChunk(c, next);

@@ -36,0 +36,0 @@ }

{
"name": "@saulx/utils",
"version": "4.3.1",
"version": "4.3.2",
"repository": "https://github.com/atelier-saulx/utils",

@@ -5,0 +5,0 @@ "files": [

Sorry, the diff of this file is not supported yet