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

workbox-streams

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-streams - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

2

_version.js
"use strict";
// @ts-ignore
try {
self['workbox:streams:5.0.0'] && _();
self['workbox:streams:5.1.0'] && _();
}
catch (e) { }

@@ -6,3 +6,3 @@ this.workbox = this.workbox || {};

try {
self['workbox:streams:5.0.0'] && _();
self['workbox:streams:5.1.0'] && _();
} catch (e) {}

@@ -9,0 +9,0 @@

@@ -1,2 +0,2 @@

this.workbox=this.workbox||{},this.workbox.streams=function(e,n,t){"use strict";try{self["workbox:streams:5.0.0"]&&_()}catch(e){}function s(e){const t=e.map(e=>Promise.resolve(e).then(e=>(function(e){return e instanceof Response?e.body.getReader():e instanceof ReadableStream?e.getReader():new Response(e).body.getReader()})(e))),s=new n.Deferred;let r=0;const o=new ReadableStream({pull(e){return t[r].then(e=>e.read()).then(n=>{if(n.done)return++r>=t.length?(e.close(),void s.resolve()):this.pull(e);e.enqueue(n.value)}).catch(e=>{throw s.reject(e),e})},cancel(){s.resolve()}});return{done:s.promise,stream:o}}function r(e={}){const n=new Headers(e);return n.has("content-type")||n.set("content-type","text/html"),n}function o(e,n){const{done:t,stream:o}=s(e),c=r(n);return{done:t,response:new Response(o,{headers:c})}}function c(){return t.canConstructReadableStream()}return e.concatenate=s,e.concatenateToResponse=o,e.isSupported=c,e.strategy=function(e,n){return async({event:t,request:s,url:a,params:u})=>{const i=e.map(e=>Promise.resolve(e({event:t,request:s,url:a,params:u})));if(c()){const{done:e,response:s}=o(i,n);return t&&t.waitUntil(e),s}const f=i.map(async e=>{const n=await e;return n instanceof Response?n.blob():new Response(n).blob()}),p=await Promise.all(f),w=r(n);return new Response(new Blob(p),{headers:w})}},e}({},workbox.core._private,workbox.core._private);
this.workbox=this.workbox||{},this.workbox.streams=function(e,n,t){"use strict";try{self["workbox:streams:5.1.0"]&&_()}catch(e){}function s(e){const t=e.map(e=>Promise.resolve(e).then(e=>function(e){return e instanceof Response?e.body.getReader():e instanceof ReadableStream?e.getReader():new Response(e).body.getReader()}(e))),s=new n.Deferred;let r=0;const o=new ReadableStream({pull(e){return t[r].then(e=>e.read()).then(n=>{if(n.done)return r++,r>=t.length?(e.close(),void s.resolve()):this.pull(e);e.enqueue(n.value)}).catch(e=>{throw s.reject(e),e})},cancel(){s.resolve()}});return{done:s.promise,stream:o}}function r(e={}){const n=new Headers(e);return n.has("content-type")||n.set("content-type","text/html"),n}function o(e,n){const{done:t,stream:o}=s(e),c=r(n);return{done:t,response:new Response(o,{headers:c})}}function c(){return t.canConstructReadableStream()}return e.concatenate=s,e.concatenateToResponse=o,e.isSupported=c,e.strategy=function(e,n){return async({event:t,request:s,url:a,params:u})=>{const i=e.map(e=>Promise.resolve(e({event:t,request:s,url:a,params:u})));if(c()){const{done:e,response:s}=o(i,n);return t&&t.waitUntil(e),s}const f=i.map(async e=>{const n=await e;return n instanceof Response?n.blob():new Response(n).blob()}),p=await Promise.all(f),w=r(n);return new Response(new Blob(p),{headers:w})}},e}({},workbox.core._private,workbox.core._private);
//# sourceMappingURL=workbox-streams.prod.js.map
{
"name": "workbox-streams",
"version": "5.0.0",
"version": "5.1.0",
"license": "MIT",

@@ -31,6 +31,6 @@ "author": "Google's Web DevRel Team",

"dependencies": {
"workbox-core": "^5.0.0",
"workbox-routing": "^5.0.0"
"workbox-core": "^5.1.0",
"workbox-routing": "^5.1.0"
},
"gitHead": "571ffded1872309a305f108a99a5a36982fde342"
"gitHead": "2a6b84b892b5c404671b898e926bf37b65d261da"
}
// @ts-ignore
try{self['workbox:streams:5.0.0']&&_()}catch(e){}
try{self['workbox:streams:5.1.0']&&_()}catch(e){}

@@ -48,4 +48,4 @@ /*

function concatenate(sourcePromises: Promise<StreamSource>[]): {
done: Promise<void>,
stream: ReadableStream,
done: Promise<void>;
stream: ReadableStream;
} {

@@ -66,3 +66,3 @@ if (process.env.NODE_ENV !== 'production') {

const streamDeferred:Deferred<void> = new Deferred();
const streamDeferred: Deferred<void> = new Deferred();

@@ -100,3 +100,3 @@ let i = 0;

controller.close();
streamDeferred.resolve!();
streamDeferred.resolve();
return;

@@ -114,3 +114,3 @@ }

}
streamDeferred.reject!(error);
streamDeferred.reject(error);
throw error;

@@ -125,3 +125,3 @@ });

streamDeferred.resolve!();
streamDeferred.resolve();
},

@@ -128,0 +128,0 @@ });

@@ -34,3 +34,3 @@ /*

sourcePromises: Promise<StreamSource>[],
headersInit: HeadersInit): {done: Promise<void>, response: Response} {
headersInit: HeadersInit): {done: Promise<void>; response: Response} {
const {done, stream} = concatenate(sourcePromises);

@@ -37,0 +37,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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