Comparing version 3.0.3 to 3.0.4
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ItMerge = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var ItMerge=(()=>{var y=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var M=(r,e)=>{for(var t in e)y(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of P(e))!I.call(r,u)&&u!==t&&y(r,u,{get:()=>e[u],enumerable:!(n=N(e,u))||n.enumerable});return r};var A=r=>_(y({},"__esModule",{value:!0}),r);var B={};M(B,{default:()=>q});function c(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}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 t=this.head;this.head=t.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 t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var w=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function v(r={}){return j(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function j(r,e){e=e??{};let t=e.onEnd,n=new h,u,o,f,b=c(),E=async()=>{try{return n.isEmpty()?f?{done:!0}:await new Promise((i,s)=>{o=d=>{o=null,n.push(d);try{i(r(n))}catch(l){s(l)}return u}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{b.resolve(),b=c()})}},x=i=>o!=null?o(i):(n.push(i),u),z=i=>(n=new h,o!=null?o({error:i}):(n.push({error:i}),u)),g=i=>{if(f)return u;if(e?.objectMode!==!0&&i?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return x({done:!1,value:i})},m=i=>f?u:(f=!0,i!=null?z(i):x({done:!0})),L=()=>(n=new h,m(),{done:!0}),S=i=>(m(i),{done:!0});if(u={[Symbol.asyncIterator](){return this},next:E,return:L,throw:S,push:g,end:m,get readableLength(){return n.size},onEmpty:async i=>{let s=i?.signal;if(s?.throwIfAborted(),n.isEmpty())return;let d,l;s!=null&&(d=new Promise((D,k)=>{l=()=>{k(new w)},s.addEventListener("abort",l)}));try{await Promise.race([b.promise,d])}finally{l!=null&&s!=null&&s?.removeEventListener("abort",l)}}},t==null)return u;let a=u;return u={[Symbol.asyncIterator](){return this},next(){return a.next()},throw(i){return a.throw(i),t!=null&&(t(i),t=void 0),{done:!0}},return(){return a.return(),t!=null&&(t(),t=void 0),{done:!0}},push:g,end(i){return a.end(i),t!=null&&(t(i),t=void 0),u},get readableLength(){return a.readableLength}},u}function R(r){return r[Symbol.asyncIterator]!=null}function T(...r){let e=[];for(let t of r)R(t)||e.push(t);return e.length===r.length?function*(){for(let t of e)yield*t}():async function*(){let t=v({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async n=>{for await(let u of n)t.push(u)})),t.end()}catch(n){t.end(n)}}),yield*t}()}var q=T;return A(B);})(); | ||
"use strict";var ItMerge=(()=>{var y=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var M=(r,e)=>{for(var t in e)y(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of P(e))!I.call(r,u)&&u!==t&&y(r,u,{get:()=>e[u],enumerable:!(i=N(e,u))||i.enumerable});return r};var A=r=>_(y({},"__esModule",{value:!0}),r);var B={};M(B,{default:()=>q});function c(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}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 t=this.head;this.head=t.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 t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var w=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function g(r={}){return j(t=>{let i=t.shift();if(i==null)return{done:!0};if(i.error!=null)throw i.error;return{done:i.done===!0,value:i.value}},r)}function j(r,e){e=e??{};let t=e.onEnd,i=new a,u,o,f,b=c(),v=async()=>{try{return i.isEmpty()?f?{done:!0}:await new Promise((n,s)=>{o=d=>{o=null,i.push(d);try{n(r(i))}catch(h){s(h)}return u}}):r(i)}finally{i.isEmpty()&&queueMicrotask(()=>{b.resolve(),b=c()})}},x=n=>o!=null?o(n):(i.push(n),u),z=n=>(i=new a,o!=null?o({error:n}):(i.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})},m=n=>f?u:(f=!0,n!=null?z(n):x({done:!0})),L=()=>(i=new a,m(),{done:!0}),S=n=>(m(n),{done:!0});if(u={[Symbol.asyncIterator](){return this},next:v,return:L,throw:S,push:E,end:m,get readableLength(){return i.size},onEmpty:async n=>{let s=n?.signal;if(s?.throwIfAborted(),i.isEmpty())return;let d,h;s!=null&&(d=new Promise((D,k)=>{h=()=>{k(new w)},s.addEventListener("abort",h)}));try{await Promise.race([b.promise,d])}finally{h!=null&&s!=null&&s?.removeEventListener("abort",h)}}},t==null)return u;let l=u;return u={[Symbol.asyncIterator](){return this},next(){return l.next()},throw(n){return l.throw(n),t!=null&&(t(n),t=void 0),{done:!0}},return(){return l.return(),t!=null&&(t(),t=void 0),{done:!0}},push:E,end(n){return l.end(n),t!=null&&(t(n),t=void 0),u},get readableLength(){return l.readableLength},onEmpty:n=>l.onEmpty(n)},u}function R(r){return r[Symbol.asyncIterator]!=null}function T(...r){let e=[];for(let t of r)R(t)||e.push(t);return e.length===r.length?function*(){for(let t of e)yield*t}():async function*(){let t=g({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async i=>{for await(let u of i)t.push(u)})),t.end()}catch(i){t.end(i)}}),yield*t}()}var q=T;return A(B);})(); | ||
return ItMerge})); |
100
package.json
{ | ||
"name": "it-merge", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Treat one or more iterables as a single iterable", | ||
"author": "Alex Potsides <alex@achingbrain.net>", | ||
"license": "Apache-2.0 OR MIT", | ||
"homepage": "https://github.com/achingbrain/it/tree/master/packages/it-merge#readme", | ||
"homepage": "https://github.com/achingbrain/it/tree/main/packages/it-merge#readme", | ||
"repository": { | ||
@@ -15,2 +15,6 @@ "type": "git", | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"type": "module", | ||
@@ -37,87 +41,2 @@ "types": "./dist/src/index.d.ts", | ||
}, | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ | ||
"breaking": true, | ||
"release": "major" | ||
}, | ||
{ | ||
"revert": true, | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "feat", | ||
"release": "minor" | ||
}, | ||
{ | ||
"type": "fix", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "deps", | ||
"release": "patch" | ||
}, | ||
{ | ||
"scope": "no-release", | ||
"release": false | ||
} | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Documentation" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "Dependencies" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
}, | ||
"scripts": { | ||
@@ -133,12 +52,11 @@ "build": "aegir build", | ||
"test:firefox": "aegir test -t browser -- --browser firefox", | ||
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox", | ||
"release": "aegir release" | ||
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox" | ||
}, | ||
"dependencies": { | ||
"it-pushable": "^3.2.0" | ||
"it-pushable": "^3.2.3" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^41.1.9", | ||
"aegir": "^42.2.5", | ||
"it-all": "^3.0.0" | ||
} | ||
} |
@@ -0,3 +1,5 @@ | ||
# it-merge | ||
[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it) | ||
[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amaster) | ||
[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain) | ||
@@ -8,2 +10,17 @@ > Treat one or more iterables as a single iterable | ||
<!-- | ||
!IMPORTANT! | ||
Everything in this README between "# About" and "# Install" is automatically | ||
generated and will be overwritten the next time the doc generator is run. | ||
To make changes to this section, please update the @packageDocumentation section | ||
of src/index.js or src/index.ts | ||
To experiment with formatting, please run "npm run docs" from the root of this | ||
repo and examine the changes made. | ||
--> | ||
Merge several (async)iterables into one, yield values as they arrive. | ||
@@ -61,2 +78,6 @@ | ||
# API Docs | ||
- <https://achingbrain.github.io/it/modules/it_merge.html> | ||
# License | ||
@@ -63,0 +84,0 @@ |
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
10
240
91
16156
Updatedit-pushable@^3.2.3