Files
doneit-web/.angular/cache/14.2.12/babel-webpack/5204d7f5a5e2e6aac020bbaf6cab9d82.json
T

1 line
9.7 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"(function (root, factory) {\n // eslint-disable-next-line no-undef\n if (typeof define === \"function\" && define.amd) {\n // eslint-disable-next-line no-undef\n define(\"fifo-process-queue\", [], factory);\n // eslint-disable-next-line no-undef\n } else if (typeof module === \"object\" && module.exports) {\n // eslint-disable-next-line no-undef\n module.exports = factory();\n } else {\n root.FIFOProcessQueue = factory();\n }\n // eslint-disable-next-line no-undef\n})(typeof self !== \"undefined\" ? self : this, function () {\n function simpleFIFOProcessQueue(processor) {\n var queue = [];\n function done() {\n queue.shift();\n if (queue.length > 0) {\n processor(queue[0], done);\n }\n }\n function push(data) {\n queue.push(data);\n if (queue.length === 1) {\n processor(queue[0], done);\n }\n }\n function pushAll(data) {\n data.forEach(push);\n }\n return {\n push: push,\n pushAll: pushAll\n };\n }\n\n // 2^53 is the largest power of 2 for which 2^x !== 2^x - 1\n var maxId = Math.pow(2, 53);\n function postProcessingFIFOProcessQueue(processor, postProcessor, maxConcurrency) {\n var currentId = 0;\n var pending = [];\n var processing = [];\n function nextId() {\n currentId = (currentId + 1) % maxId;\n return currentId;\n }\n function startPending() {\n while (processing.length < maxConcurrency && pending.length > 0) {\n var item = {\n id: nextId(),\n data: pending.shift(),\n done: false\n };\n processing.push(item);\n processor(item.data, function () {\n done(item.id);\n });\n }\n }\n function done(id) {\n var item;\n for (var i = 0; i < processing.length; i++) {\n item = processing[i];\n if (item.id === id && !item.done) {\n item.done = true;\n }\n }\n while (processing.length > 0 && processing[0].done) {\n item = processing.shift();\n postProcessor(item.data);\n }\n startPending();\n }\n function push(data) {\n pending.push(data);\n startPending();\n }\n function pushAll(data) {\n data.forEach(push);\n }\n return {\n push: push,\n pushAll: pushAll\n };\n }\n return function (processor, postProcessor, maxConcurrency) {\n if (typeof processor !== \"function\") {\n throw new Error(\"processor must be a function\");\n }\n if (typeof postProcessor !== \"function\" && typeof postProcessor !== \"undefined\") {\n throw new Error(\"postProcessor must be a function\");\n }\n if (typeof maxConcurrency === \"undefined\") {\n maxConcurrency = Number.MAX_VALUE;\n } else if (typeof maxConcurrency !== \"number\") {\n throw new Error(\"maxConcurrency must be a number\");\n } else if (maxConcurrency < 1) {\n throw new Error(\"maxConcurrency must be at least 1\");\n }\n return postProcessor ? postProcessingFIFOProcessQueue(processor, postProcessor, maxConcurrency) : simpleFIFOProcessQueue(processor);\n };\n});","map":{"version":3,"names":["root","factory","define","amd","module","exports","FIFOProcessQueue","self","simpleFIFOProcessQueue","processor","queue","done","shift","length","push","data","pushAll","forEach","maxId","Math","pow","postProcessingFIFOProcessQueue","postProcessor","maxConcurrency","currentId","pending","processing","nextId","startPending","item","id","i","Error","Number","MAX_VALUE"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/fifo-process-queue/index.js"],"sourcesContent":["(function (root, factory) {\n // eslint-disable-next-line no-undef\n if (typeof define === \"function\" && define.amd) {\n // eslint-disable-next-line no-undef\n define(\"fifo-process-queue\", [], factory);\n // eslint-disable-next-line no-undef\n } else if (typeof module === \"object\" && module.exports) {\n // eslint-disable-next-line no-undef\n module.exports = factory();