{"_id":"priority-queue-typescript","_rev":"6-9c8920c8f81cedcfd425ede9387f897d","name":"priority-queue-typescript","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"priority-queue-typescript","version":"1.0.0","keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","_id":"priority-queue-typescript@1.0.0","maintainers":[{"name":"childrentime","email":"wul55267@gmail.com"}],"homepage":"https://github.com/childrentime/PriorityQueue#readme","bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"dist":{"shasum":"68f601d3137ac5f872eb5d84175486dae4c100aa","tarball":"https://registry.npmjs.org/priority-queue-typescript/-/priority-queue-typescript-1.0.0.tgz","fileCount":8,"integrity":"sha512-/p+vd/MHfP7dTs/SkdVFF7vsxd0voG1uGQVf5X9Gjd/lbHXHmclkIW7mzi2sa0K5Isxyq+NOyFWiwZcPl77p6g==","signatures":[{"sig":"MEYCIQChwtglfeVbd/eqVglFYkgZ7BdrsffephE0Oxy/ssBbRQIhAN2vZNmOX7cSlvu9+u01EzIpvqOGKx/dFKLXr1sYWkbV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1v3OCRA9TVsSAnZWagAAVGkP/i2dZQL0fWcoDnT2Wyz0\nPPDrNCs/B79siUvAawaHR4KH6aQrz/jx6xWZR3rsyCn4NXd2RfOebdHkhHsU\njobDnZzjxg0RSOziTyD7Z2fYotzDs40f5+XH2SD0Tn8OjBaVAQjYr/cVeV2P\nGLopZMmA4SUARJzyhsObjtTEAsUIVsxaAPonJ9eS3udeuOOiigXiTbNgDf9K\nzg6dIhLFGc1SGn+Be9Ip2jGJKOZG8cpZ+GhqAu5wTlMDSMoxSPTAQKU+slCR\nmfdP/NQcXUMtIuYw5TOZoDC7zaLSazhBs1t5jcZk0J8O/6+qNBQFW0ckTv7g\naYbrJHuEpoQsfG6sJydh15Vq6+xz7nnp67LRGfmLGyV/ZC3pgTbR0RphHzDk\nvxZeZtTTzyLgaiy6YpF/jpPU40j6W/Tlov8NQm6PgHoI5MDpECZ9NgOPb5c8\nO3Pj9AXBnnjGNOswKxDaDVl6T3Xxu1uHMm0IN2klnsTX1j/AxoT+70gyRDho\n7I7nDKBYQ/uS7IpPSOCERD8LyNUIMnuUMBh1YWv6W+nxRO7OgfNqoMJjNSio\nb41ypV5/wEpwl7iKL4BqGz5HpHhQxyRNJ4VgQqg8CEv58jfk3w7PoIwCZj29\nkgARglWSJeO+UBaYD2L+ofGl6j7UXN4Ma8KDtKl7D9pbD7aEQdEXLjVsEHzE\n/KLa\r\n=0pjF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/priority-queue/PriorityQueue.js","types":"src/priority-queue/PriorityQueue.ts","gitHead":"4407da5d0a6e4d9d3546db640b0b425f093bd6cc","scripts":{"test":"jest","build":"tsc src/priority-queue/PriorityQueue.ts","coverage":"jest --coverage"},"_npmUser":{"name":"childrentime","email":"wul55267@gmail.com"},"repository":{"url":"git+https://github.com/childrentime/PriorityQueue.git","type":"git"},"_npmVersion":"8.2.0","description":"Priority queue data structure where you are able to set your own compare function.","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","babel-jest":"^27.4.4","@babel/core":"^7.16.0","@types/jest":"^27.0.3","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0"},"_npmOperationalInternal":{"tmp":"tmp/priority-queue-typescript_1.0.0_1641479629945_0.24350921733440867","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"priority-queue-typescript","version":"1.0.1","keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","_id":"priority-queue-typescript@1.0.1","maintainers":[{"name":"childrentime","email":"wul55267@gmail.com"}],"homepage":"https://github.com/childrentime/PriorityQueue#readme","bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"dist":{"shasum":"7a89a8513af3698f7abbf3fe1123ecdf3cd22b7b","tarball":"https://registry.npmjs.org/priority-queue-typescript/-/priority-queue-typescript-1.0.1.tgz","fileCount":9,"integrity":"sha512-Apycf6CgjdPRNfpZ8qgQeHVRe4B6R51QAd94k6fE13tGUpW1RLv8+ZeJipl2f0j/No3nt2Gk7dF2f+i1Au/I2w==","signatures":[{"sig":"MEUCIQC8/q6nqj3k4b2ikVGhGTpYQAWq7te8QPLdF9iki1va4gIgYTWbbleIaXQiWaJ+m92a3t5XNMmV/HtBFtq+DokdKww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1v4CCRA9TVsSAnZWagAAftgP/2gl3S8ivAXEAa6TJAVB\nroissHapHzo+Turf+r4H4heVNYnf5xYraKyt678ahjmGo7veRGuIGcFJxl6d\n6Ge5g1A+x0T/v/PDbCllFpKLFwZVlcwWf3oToRsL5itU5ANFSicdFiBfT1Q7\nh5aIlsJ6KZcOUL12+Er9QPZnzgpb6/D1dhdqq6CGc7DWxmCep9T+zN7aZri5\nBfQHqNyTSFzOThapRh7XtLX9ui+QMAtdkSvdw1QYwnJaNsZHHuoxCIhZh12A\nxTIt+LPCtsR+Ma3xwcpLMPHqsmZLFgu1zo+Bct1EYcIa5nkiV9yRruOaDECc\npv4VMJ62LQvddJJFfjw8TudWVNNmZEd92hQ8GQumt7OYI70Q+y6a3WGukA4W\nxwAAbcs8TOiBvd2tpl71PMoDEcjwwFl3vOTkli5a3/DsRWpGMYHg2YM6dB0L\nmWPBVnoDWtAOfMvuhkQCm7PlSEBRUBWCuj7Jc+qK4EbRr4soJRfVDFihNoAl\nvbCP15q4b9m4Az5KVP3m+HKcp+i+/G8mCBAzETwmH7Bji/IAn07sjbiCs86r\nuYdCQGinPHBXcqkxyM+nCEJCqSwx1f3AfoAXuwZDYJMvjP+WQUEigm+0iZ/w\nQViWQLGiZrmCJU9pOSIURX5/e8CisbVwjj3dGamYFAdLC3rv61e2wPLWzWY5\n8nvD\r\n=Ihif\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/priority-queue/PriorityQueue.js","types":"src/priority-queue/PriorityQueue.ts","gitHead":"4407da5d0a6e4d9d3546db640b0b425f093bd6cc","scripts":{"test":"jest","build":"tsc src/priority-queue/PriorityQueue.ts","coverage":"jest --coverage"},"_npmUser":{"name":"childrentime","email":"wul55267@gmail.com"},"repository":{"url":"git+https://github.com/childrentime/PriorityQueue.git","type":"git"},"_npmVersion":"8.2.0","description":"Priority queue data structure where you are able to set your own compare function.","directories":{},"_nodeVersion":"14.17.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","babel-jest":"^27.4.4","@babel/core":"^7.16.0","@types/jest":"^27.0.3","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0"},"_npmOperationalInternal":{"tmp":"tmp/priority-queue-typescript_1.0.1_1641479682650_0.37233239748534896","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"priority-queue-typescript","version":"2.0.0","keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","_id":"priority-queue-typescript@2.0.0","maintainers":[{"name":"lianwenwu","email":"wul55267@gmail.com"}],"homepage":"https://github.com/childrentime/PriorityQueue#readme","bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"dist":{"shasum":"a94a1ef8ec6f963f4b540928e6a2766d90a41f7f","tarball":"https://registry.npmjs.org/priority-queue-typescript/-/priority-queue-typescript-2.0.0.tgz","fileCount":15,"integrity":"sha512-b3jXt9quA9IV+6Jf89zIBl4dwMlYZ7NtnygAgF+J75z92yGJy+wMGXe8b0frlbJ3K+GeU5JKHU72dn3wKZTAfA==","signatures":[{"sig":"MEYCIQCHTOnncFR2Bp7xcmaSB9Uh4eJQmRcZbYdFDH2yI7BrqgIhAKRK4hLQGOI1kAT5xArpPfbqSUMEguJuhkB8gSb7PSea","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28365},"main":"./dist/index.cjs","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"b9b400d72459f750941208812eb614f878a049f1","scripts":{"test":"jest","build":"bunchee","release":"esno scripts/publish.ts","coverage":"jest --coverage","release:prepare":"bump"},"_npmUser":{"name":"lianwenwu","email":"wul55267@gmail.com"},"repository":{"url":"git+https://github.com/childrentime/PriorityQueue.git","type":"git"},"_npmVersion":"10.5.0","description":"Priority queue data structure where you are able to set your own compare function.","directories":{},"sideEffects":false,"_nodeVersion":"20.12.1","_hasShrinkwrap":false,"devDependencies":{"esno":"^4.8.0","jest":"^27.4.4","bunchee":"^6.0.3","consola":"^3.2.3","babel-jest":"^27.4.4","@babel/core":"^7.16.0","@types/jest":"^27.0.3","@types/node":"^22.10.1","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0","@jsdevtools/version-bump-prompt":"^6.1.0"},"_npmOperationalInternal":{"tmp":"tmp/priority-queue-typescript_2.0.0_1733663180821_0.8154018987969431","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"priority-queue-typescript","version":"2.0.1","keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","_id":"priority-queue-typescript@2.0.1","maintainers":[{"name":"lianwenwu","email":"wul55267@gmail.com"}],"homepage":"https://github.com/childrentime/PriorityQueue#readme","bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"dist":{"shasum":"21143f93b24062a10bd5cf176367ad00423452ea","tarball":"https://registry.npmjs.org/priority-queue-typescript/-/priority-queue-typescript-2.0.1.tgz","fileCount":10,"integrity":"sha512-iQ1OoQ2IE3IcM/vGaiwhfJJd0DgPBUz5+4a9dLk2CZDcYlu4eYlue/gVfquwqh0xFDjJA2ce+9IMczBg4Yp1AQ==","signatures":[{"sig":"MEUCIQCesd+UharPjDmuKl0q7fVOn5jSgJnJBUzhyQkEAQicOwIgI9mLR95FeZglhNDpW+eh/DtV7a5ASJJzOYnQVNUk+ZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15594},"main":"./dist/index.cjs","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"c80a4acbcfca3ddfdc67381b75f274752bf7c7c9","scripts":{"test":"jest","build":"bunchee","release":"esno scripts/publish.ts","coverage":"jest --coverage","release:prepare":"bump"},"_npmUser":{"name":"lianwenwu","email":"wul55267@gmail.com"},"repository":{"url":"git+https://github.com/childrentime/PriorityQueue.git","type":"git"},"_npmVersion":"10.5.0","description":"Priority queue data structure where you are able to set your own compare function.","directories":{},"sideEffects":false,"_nodeVersion":"20.12.1","_hasShrinkwrap":false,"devDependencies":{"esno":"^4.8.0","jest":"^27.4.4","bunchee":"^6.0.3","consola":"^3.2.3","babel-jest":"^27.4.4","@babel/core":"^7.16.0","@types/jest":"^27.0.3","@types/node":"^22.10.1","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0","@jsdevtools/version-bump-prompt":"^6.1.0"},"_npmOperationalInternal":{"tmp":"tmp/priority-queue-typescript_2.0.1_1733911123945_0.29835735335776703","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"priority-queue-typescript","version":"2.0.3","repository":{"type":"git","url":"git+https://github.com/childrentime/PriorityQueue.git"},"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","description":"Priority queue data structure where you are able to set your own compare function.","sideEffects":false,"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","devDependencies":{"@babel/core":"^7.16.0","@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.16.0","@jsdevtools/version-bump-prompt":"^6.1.0","@types/jest":"^27.0.3","@types/node":"^22.10.1","babel-jest":"^27.4.4","bunchee":"^6.0.3","consola":"^3.2.3","esno":"^4.8.0","jest":"^27.4.4"},"scripts":{"build":"bunchee","test":"jest","coverage":"jest --coverage","release:prepare":"bump","release":"esno scripts/publish.ts"},"keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"_id":"priority-queue-typescript@2.0.3","gitHead":"d814ea4f57d83ee8b5a7285169a851ace1fcebca","bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"homepage":"https://github.com/childrentime/PriorityQueue#readme","_nodeVersion":"20.12.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-/0vW1F1dahvFb+63HMNkAG2kW6MHNELy6mZ2MsOgxQke3/EbVUV9bjRZUgQDaIFG22O2/C7r1mBbsFiTA/iFBw==","shasum":"0c7f46a97758a84c64ef4acc754b50f759413dba","tarball":"https://registry.npmjs.org/priority-queue-typescript/-/priority-queue-typescript-2.0.3.tgz","fileCount":8,"unpackedSize":17872,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlo/hW0R2fxvUGD0tlTCQ2ZXe8loqkI/mdYUUaSyQMaAiEAnskqR0nswrhKNTaeYbTv1Pj3p9lIrCD5J0ZF1c0Uz0g="}]},"_npmUser":{"name":"lianwenwu","email":"wul55267@gmail.com"},"directories":{},"maintainers":[{"name":"lianwenwu","email":"wul55267@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/priority-queue-typescript_2.0.3_1733917350833_0.41378389342840927"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-06T14:33:49.945Z","modified":"2024-12-11T11:42:31.163Z","1.0.0":"2022-01-06T14:33:50.133Z","1.0.1":"2022-01-06T14:34:42.794Z","2.0.0":"2024-12-08T13:06:21.006Z","2.0.1":"2024-12-11T09:58:44.124Z","2.0.3":"2024-12-11T11:42:30.990Z"},"bugs":{"url":"https://github.com/childrentime/PriorityQueue/issues"},"author":{"name":"儿时","email":"58261676+childrentime@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/childrentime/PriorityQueue#readme","keywords":["priority-queue","heap","custom-comparator","comparator","data-structure","data-structures","priority","typescript","queue"],"repository":{"type":"git","url":"git+https://github.com/childrentime/PriorityQueue.git"},"description":"Priority queue data structure where you are able to set your own compare function.","maintainers":[{"name":"lianwenwu","email":"wul55267@gmail.com"}],"readme":"```ts\nimport { PriorityQueue } from 'priority-queue-typescript';\n\ndescribe('PriorityQueue', () => {\n  it('should create empty priorityQueue', () => {\n    const queue = new PriorityQueue<number>();\n    expect(queue).not.toBeNull();\n  });\n\n  it('should check add and poll function', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => b - a\n    );\n    queue.add(10);\n    queue.add(100);\n    queue.add(9);\n    queue.add(3);\n    queue.add(5000);\n    queue.add(4);\n    queue.add(40);\n    expect(queue.poll()).toBe(5000);\n    expect(queue.poll()).toBe(100);\n    expect(queue.poll()).toBe(40);\n    expect(queue.poll()).toBe(10);\n    expect(queue.poll()).toBe(9);\n    expect(queue.poll()).toBe(4);\n    expect(queue.poll()).toBe(3);\n    expect(queue.poll()).toBe(null);\n    expect(queue.size()).toBe(0);\n    expect(queue.empty()).toBe(true);\n  });\n\n  it('should check peek method', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => a - b\n    );\n    queue.add(10);\n    queue.add(100);\n    expect(queue.peek()).toBe(10);\n    expect(queue.peek()).toBe(10);\n  });\n\n  it('should check contains method', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => a - b\n    );\n    queue.add(10);\n    queue.add(100);\n    expect(queue.contains(10)).toBe(true);\n  });\n\n  it('should check clear method', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => a - b\n    );\n    queue.add(10);\n    queue.add(100);\n    expect(queue.empty()).toBe(false);\n    queue.clear();\n    expect(queue.empty()).toBe(true);\n    expect(queue.poll()).toBe(null);\n  });\n\n  it('should check toArray method', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => a - b\n    );\n    queue.add(10);\n    queue.add(100);\n    const array = queue.toArray();\n    expect(array).toContain(10);\n    expect(array).toContain(100);\n  });\n\n  it('should check iterator ', () => {\n    const queue = new PriorityQueue<number>(\n      10,\n      (a: number, b: number) => a - b\n    );\n    queue.add(10);\n    queue.add(100);\n    let count = 0;\n    for (const item of queue) {\n      count += item;\n    }\n    expect(count).toBe(110);\n  });\n\n  it('should check grow built in', () => {\n    const queue = new PriorityQueue<number>(1);\n    queue.add(10);\n    queue.add(100);\n    queue.add(5000);\n    queue.add(4);\n    expect(queue.size()).toBe(4);\n    queue.poll();\n    queue.poll();\n    queue.poll();\n    queue.poll();\n    expect(queue.size()).toBe(0);\n  });\n\n  it('should check toString', () => {\n    const queue = new PriorityQueue<number>(1);\n    queue.add(10);\n    expect(queue.toString()).toBe('10');\n  });\n});\n```\n","readmeFilename":"README.md"}