Changeset 79a0317 for imaps-frontend/node_modules/fastq
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- Location:
- imaps-frontend/node_modules/fastq
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/fastq/package.json
r0c6b92a r79a0317 1 1 { 2 "name": "fastq", 3 "version": "1.17.1", 4 "description": "Fast, in memory work queue", 5 "main": "queue.js", 6 "scripts": { 7 "lint": "standard --verbose | snazzy", 8 "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js", 9 "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js", 10 "test:report": "npm run lint && npm run unit:report", 11 "test": "npm run lint && npm run unit", 12 "typescript": "tsc --project ./test/tsconfig.json", 13 "legacy": "tape test/test.js" 2 "_from": "fastq@^1.6.0", 3 "_id": "fastq@1.18.0", 4 "_inBundle": false, 5 "_integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", 6 "_location": "/fastq", 7 "_phantomChildren": {}, 8 "_requested": { 9 "type": "range", 10 "registry": true, 11 "raw": "fastq@^1.6.0", 12 "name": "fastq", 13 "escapedName": "fastq", 14 "rawSpec": "^1.6.0", 15 "saveSpec": null, 16 "fetchSpec": "^1.6.0" 14 17 }, 15 "pre-commit": [ 16 "test", 17 "typescript" 18 "_requiredBy": [ 19 "/@nodelib/fs.walk" 18 20 ], 19 "repository": { 20 "type": "git", 21 "url": "git+https://github.com/mcollina/fastq.git" 21 "_resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", 22 "_shasum": "d631d7e25faffea81887fe5ea8c9010e1b36fee0", 23 "_spec": "fastq@^1.6.0", 24 "_where": "/home/stevetosak/Proekt/IMaps/imaps-frontend/node_modules/@nodelib/fs.walk", 25 "author": { 26 "name": "Matteo Collina", 27 "email": "hello@matteocollina.com" 22 28 }, 23 "keywords": [24 "fast",25 "queue",26 "async",27 "worker"28 ],29 "author": "Matteo Collina <hello@matteocollina.com>",30 "license": "ISC",31 29 "bugs": { 32 30 "url": "https://github.com/mcollina/fastq/issues" 33 31 }, 34 "homepage": "https://github.com/mcollina/fastq#readme", 32 "bundleDependencies": false, 33 "dependencies": { 34 "reusify": "^1.0.4" 35 }, 36 "deprecated": false, 37 "description": "Fast, in memory work queue", 35 38 "devDependencies": { 36 39 "async": "^3.1.0", … … 43 46 "typescript": "^5.0.4" 44 47 }, 45 "dependencies": { 46 "reusify": "^1.0.4" 48 "homepage": "https://github.com/mcollina/fastq#readme", 49 "keywords": [ 50 "fast", 51 "queue", 52 "async", 53 "worker" 54 ], 55 "license": "ISC", 56 "main": "queue.js", 57 "name": "fastq", 58 "pre-commit": [ 59 "test", 60 "typescript" 61 ], 62 "repository": { 63 "type": "git", 64 "url": "git+https://github.com/mcollina/fastq.git" 65 }, 66 "scripts": { 67 "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js", 68 "legacy": "tape test/test.js", 69 "lint": "standard --verbose | snazzy", 70 "test": "npm run lint && npm run unit", 71 "test:report": "npm run lint && npm run unit:report", 72 "typescript": "tsc --project ./test/tsconfig.json", 73 "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js" 47 74 }, 48 75 "standard": { … … 50 77 "example.mjs" 51 78 ] 52 } 79 }, 80 "version": "1.18.0" 53 81 } -
imaps-frontend/node_modules/fastq/queue.js
r0c6b92a r79a0317 289 289 290 290 function drained () { 291 if (queue.idle()) { 292 return new Promise(function (resolve) { 293 resolve() 291 var p = new Promise(function (resolve) { 292 process.nextTick(function () { 293 if (queue.idle()) { 294 resolve() 295 } else { 296 var previousDrain = queue.drain 297 queue.drain = function () { 298 if (typeof previousDrain === 'function') previousDrain() 299 resolve() 300 queue.drain = previousDrain 301 } 302 } 294 303 }) 295 }296 297 var previousDrain = queue.drain298 299 var p = new Promise(function (resolve) {300 queue.drain = function () {301 previousDrain()302 resolve()303 }304 304 }) 305 305 -
imaps-frontend/node_modules/fastq/test/promise.js
r0c6b92a r79a0317 247 247 process.removeListener('unhandledRejection', handleRejection) 248 248 }) 249 250 test('drained should resolve after async tasks complete', async function (t) { 251 const logs = [] 252 253 async function processTask () { 254 await new Promise(resolve => setTimeout(resolve, 0)) 255 logs.push('processed') 256 } 257 258 const queue = buildQueue(processTask, 1) 259 queue.drain = () => logs.push('called drain') 260 261 queue.drained().then(() => logs.push('drained promise resolved')) 262 263 await Promise.all([ 264 queue.push(), 265 queue.push(), 266 queue.push() 267 ]) 268 269 t.deepEqual(logs, [ 270 'processed', 271 'processed', 272 'processed', 273 'called drain', 274 'drained promise resolved' 275 ], 'events happened in correct order') 276 }) 277 278 test('drained should handle undefined drain function', async function (t) { 279 const queue = buildQueue(worker, 1) 280 281 async function worker (arg) { 282 await sleep(10) 283 return arg 284 } 285 286 queue.drain = undefined 287 queue.push(1) 288 await queue.drained() 289 290 t.pass('drained resolved successfully with undefined drain') 291 })
Note:
See TracChangeset
for help on using the changeset viewer.