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

it-pushable

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-pushable - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

2

dist/index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ItPushable = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var ItPushable=(()=>{var y=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var P=(i,e)=>{for(var r in e)y(i,r,{get:e[r],enumerable:!0})},A=(i,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of _(e))!M.call(i,u)&&u!==r&&y(i,u,{get:()=>e[u],enumerable:!(t=S(e,u))||t.enumerable});return i};var I=i=>A(y({},"__esModule",{value:!0}),i);var T={};P(T,{AbortError:()=>b,pushable:()=>R,pushableV:()=>j});function c(){let i={};return i.promise=new Promise((e,r)=>{i.resolve=e,i.reject=r}),i}var p=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},h=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new p(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new p(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var b=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function R(i={}){return g(r=>{let t=r.shift();if(t==null)return{done:!0};if(t.error!=null)throw t.error;return{done:t.done===!0,value:t.value}},i)}function j(i={}){return g(r=>{let t,u=[];for(;!r.isEmpty()&&(t=r.shift(),t!=null);){if(t.error!=null)throw t.error;t.done===!1&&u.push(t.value)}return t==null?{done:!0}:{done:t.done===!0,value:u}},i)}function g(i,e){e=e??{};let r=e.onEnd,t=new h,u,l,f,m=c(),v=async()=>{try{return t.isEmpty()?f?{done:!0}:await new Promise((n,s)=>{l=d=>{l=null,t.push(d);try{n(i(t))}catch(o){s(o)}return u}}):i(t)}finally{t.isEmpty()&&queueMicrotask(()=>{m.resolve(),m=c()})}},x=n=>l!=null?l(n):(t.push(n),u),z=n=>(t=new h,l!=null?l({error:n}):(t.push({error:n}),u)),E=n=>{if(f)return u;if(e?.objectMode!==!0&&n?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return x({done:!1,value:n})},w=n=>f?u:(f=!0,n!=null?z(n):x({done:!0})),L=()=>(t=new h,w(),{done:!0}),k=n=>(w(n),{done:!0});if(u={[Symbol.asyncIterator](){return this},next:v,return:L,throw:k,push:E,end:w,get readableLength(){return t.size},onEmpty:async n=>{let s=n?.signal;if(s?.throwIfAborted(),t.isEmpty())return;let d,o;s!=null&&(d=new Promise((q,N)=>{o=()=>{N(new b)},s.addEventListener("abort",o)}));try{await Promise.race([m.promise,d])}finally{o!=null&&s!=null&&s?.removeEventListener("abort",o)}}},r==null)return u;let a=u;return u={[Symbol.asyncIterator](){return this},next(){return a.next()},throw(n){return a.throw(n),r!=null&&(r(n),r=void 0),{done:!0}},return(){return a.return(),r!=null&&(r(),r=void 0),{done:!0}},push:E,end(n){return a.end(n),r!=null&&(r(n),r=void 0),u},get readableLength(){return a.readableLength}},u}return I(T);})();
"use strict";var ItPushable=(()=>{var y=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var P=(i,e)=>{for(var r in e)y(i,r,{get:e[r],enumerable:!0})},A=(i,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of _(e))!M.call(i,u)&&u!==r&&y(i,u,{get:()=>e[u],enumerable:!(t=S(e,u))||t.enumerable});return i};var I=i=>A(y({},"__esModule",{value:!0}),i);var T={};P(T,{AbortError:()=>b,pushable:()=>R,pushableV:()=>j});function c(){let i={};return i.promise=new Promise((e,r)=>{i.resolve=e,i.reject=r}),i}var p=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},a=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new p(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new p(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var b=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function R(i={}){return g(r=>{let t=r.shift();if(t==null)return{done:!0};if(t.error!=null)throw t.error;return{done:t.done===!0,value:t.value}},i)}function j(i={}){return g(r=>{let t,u=[];for(;!r.isEmpty()&&(t=r.shift(),t!=null);){if(t.error!=null)throw t.error;t.done===!1&&u.push(t.value)}return t==null?{done:!0}:{done:t.done===!0,value:u}},i)}function g(i,e){e=e??{};let r=e.onEnd,t=new a,u,l,f,m=c(),v=async()=>{try{return t.isEmpty()?f?{done:!0}:await new Promise((n,s)=>{l=d=>{l=null,t.push(d);try{n(i(t))}catch(h){s(h)}return u}}):i(t)}finally{t.isEmpty()&&queueMicrotask(()=>{m.resolve(),m=c()})}},x=n=>l!=null?l(n):(t.push(n),u),z=n=>(t=new a,l!=null?l({error:n}):(t.push({error:n}),u)),E=n=>{if(f)return u;if(e?.objectMode!==!0&&n?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return x({done:!1,value:n})},w=n=>f?u:(f=!0,n!=null?z(n):x({done:!0})),L=()=>(t=new a,w(),{done:!0}),k=n=>(w(n),{done:!0});if(u={[Symbol.asyncIterator](){return this},next:v,return:L,throw:k,push:E,end:w,get readableLength(){return t.size},onEmpty:async n=>{let s=n?.signal;if(s?.throwIfAborted(),t.isEmpty())return;let d,h;s!=null&&(d=new Promise((q,N)=>{h=()=>{N(new b)},s.addEventListener("abort",h)}));try{await Promise.race([m.promise,d])}finally{h!=null&&s!=null&&s?.removeEventListener("abort",h)}}},r==null)return u;let o=u;return u={[Symbol.asyncIterator](){return this},next(){return o.next()},throw(n){return o.throw(n),r!=null&&(r(n),r=void 0),{done:!0}},return(){return o.return(),r!=null&&(r(),r=void 0),{done:!0}},push:E,end(n){return o.end(n),r!=null&&(r(n),r=void 0),u},get readableLength(){return o.readableLength},onEmpty:n=>o.onEmpty(n)},u}return I(T);})();
return ItPushable}));

@@ -260,2 +260,5 @@ /**

return _pushable.readableLength;
},
onEmpty: (opts) => {
return _pushable.onEmpty(opts);
}

@@ -262,0 +265,0 @@ };

{
"name": "it-pushable",
"version": "3.2.2",
"version": "3.2.3",
"description": "An iterable that you can push values into",

@@ -5,0 +5,0 @@ "author": "Alan Shaw",

@@ -387,2 +387,5 @@ /**

return _pushable.readableLength
},
onEmpty: (opts?: AbortOptions) => {
return _pushable.onEmpty(opts)
}

@@ -389,0 +392,0 @@ }

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