Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} {
if (process.env.NODE_ENV !== 'production') {
assert!.isArray(sourcePromises, {
moduleName: 'workbox-streams',
funcName: 'concatenate',
paramName: 'sourcePromises',
});
}
const readerPromises = sourcePromises.map((sourcePromise) => {
return Promise.resolve(sourcePromise).then((source) => {
return _getReaderFromSource(source);
});
});
const streamDeferred:Deferred = new Deferred();
let i = 0;
const logMessages: any[] = [];
const stream = new ReadableStream({
pull(controller: ReadableStreamDefaultController) {
return readerPromises[i]
.then((reader) => reader.read())
.then((result) => {
if (result.done) {
if (process.env.NODE_ENV !== 'production') {
logMessages.push(['Reached the end of source:',
sourcePromises[i]]);
}
i++;
if (i >= readerPromises.length) {