{"_id":"@0bipinnata0/heap","_rev":"3-d34e365af6237f0d8dc748fe7736f909","name":"@0bipinnata0/heap","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@0bipinnata0/heap","version":"1.0.0","keywords":["heap","min-heap","data-structure","typescript"],"author":"","license":"MIT","_id":"@0bipinnata0/heap@1.0.0","maintainers":[{"name":"0bipinnata0","email":"odinzero@outlook.com"}],"dist":{"shasum":"6d7650976b5780e3dca7fd0572f0037ee8792fc2","tarball":"https://registry.npmjs.org/@0bipinnata0/heap/-/heap-1.0.0.tgz","fileCount":9,"integrity":"sha512-8U7lJYJvoi3ZnEOI99Zprod9pxHIJkKoRjynNKpy/EPbF9nuyvJVNtrirbvtrN25FwFwBsWXQtotM7ULSEDcEw==","signatures":[{"sig":"MEUCIQCkwebdQC6kBjZqLTGN+CVjHT0YnatoKQKla4Kb7MAaSgIgRRJzkN4xWRZiV4yYSfY4yf65+LS6nyDkdIljp55o9JQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14937},"main":"./dist/index.js","type":"module","_from":"file:0bipinnata0-heap-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"0bipinnata0","email":"odinzero@outlook.com"},"_resolved":"/tmp/83d54d9222b2dfc1b14c20ee18f6b901/0bipinnata0-heap-1.0.0.tgz","_integrity":"sha512-8U7lJYJvoi3ZnEOI99Zprod9pxHIJkKoRjynNKpy/EPbF9nuyvJVNtrirbvtrN25FwFwBsWXQtotM7ULSEDcEw==","_npmVersion":"10.8.2","description":"A TypeScript implementation of a min heap data structure","directories":{},"_nodeVersion":"20.18.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.7","typescript":"^5.8.2","@types/node":"^22.13.9","@vitest/coverage-v8":"^3.0.7"},"_npmOperationalInternal":{"tmp":"tmp/heap_1.0.0_1741085546141_0.09500982181971418","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@0bipinnata0/heap","version":"1.0.1","keywords":["heap","min-heap","data-structure","typescript"],"author":"","license":"MIT","_id":"@0bipinnata0/heap@1.0.1","maintainers":[{"name":"0bipinnata0","email":"odinzero@outlook.com"}],"dist":{"shasum":"e34151a4640f7799eff32469d97c5243d673e4d3","tarball":"https://registry.npmjs.org/@0bipinnata0/heap/-/heap-1.0.1.tgz","fileCount":9,"integrity":"sha512-nopo2lsQlMwmj/C5Y19xlJH1tiVSYm/DZpbHuT8sglt2kKkzFSkko4hyzmbbJLwJeuSBQsaOxKKDuVF0ieD7gQ==","signatures":[{"sig":"MEQCICQXglucW74L6wXGwB5woOVIt653LuJ9Iy4MbA8pXiRZAiAPvaowFYs5J2SeIudtyQG2hHiPdmDBYGuzPPHaexDmVg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12172},"main":"./dist/index.js","type":"module","_from":"file:0bipinnata0-heap-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"0bipinnata0","email":"odinzero@outlook.com"},"_resolved":"/tmp/e94ebf351f584fc8953e8e9c5dec078c/0bipinnata0-heap-1.0.1.tgz","_integrity":"sha512-nopo2lsQlMwmj/C5Y19xlJH1tiVSYm/DZpbHuT8sglt2kKkzFSkko4hyzmbbJLwJeuSBQsaOxKKDuVF0ieD7gQ==","_npmVersion":"10.8.2","description":"A TypeScript implementation of a min heap data structure","directories":{},"_nodeVersion":"20.18.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.7","typescript":"^5.8.2","@types/node":"^22.13.9","@vitest/coverage-v8":"^3.0.7"},"_npmOperationalInternal":{"tmp":"tmp/heap_1.0.1_1741090241731_0.3046821982836352","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@0bipinnata0/heap","version":"1.0.2","keywords":["heap","min-heap","data-structure","typescript"],"author":{"name":"0bipinnata0"},"license":"MIT","_id":"@0bipinnata0/heap@1.0.2","maintainers":[{"name":"0bipinnata0","email":"odinzero@outlook.com"}],"dist":{"shasum":"0d8a98a63308ecca0af4ec97ccf2483564dd34dd","tarball":"https://registry.npmjs.org/@0bipinnata0/heap/-/heap-1.0.2.tgz","fileCount":9,"integrity":"sha512-kUyTwQRvYYI4J7v2qhGGu04GPT7E/aMbhPXvf3r47FJ8aqbvZOs9WNxtxn36ysyZZoEr8vRYlW53rR+w0Uy46Q==","signatures":[{"sig":"MEUCIQDzoJaaugl5+2hX0G60Je2uqh/asdcPiL2aX3eOq9XDIQIgSMOL2ZPZgeYrUwrqovOApkkN6ZGypakcOXN0nxzrFT0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12860},"main":"./dist/index.js","type":"module","_from":"file:0bipinnata0-heap-1.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest","build":"tsup","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"0bipinnata0","email":"odinzero@outlook.com"},"_resolved":"/tmp/feb38f651ebe13c10091ecdc4db34a12/0bipinnata0-heap-1.0.2.tgz","_integrity":"sha512-kUyTwQRvYYI4J7v2qhGGu04GPT7E/aMbhPXvf3r47FJ8aqbvZOs9WNxtxn36ysyZZoEr8vRYlW53rR+w0Uy46Q==","_npmVersion":"10.8.2","description":"A TypeScript implementation of a min heap data structure","directories":{},"_nodeVersion":"20.18.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.7","typescript":"^5.8.2","@types/node":"^22.13.9","@vitest/coverage-v8":"^3.0.7"},"_npmOperationalInternal":{"tmp":"tmp/heap_1.0.2_1741090640803_0.3613721337819784","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@0bipinnata0/heap","version":"1.0.3","description":"A TypeScript implementation of a min heap data structure","type":"module","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"keywords":["heap","min-heap","data-structure","typescript"],"author":{"name":"0bipinnata0"},"license":"MIT","homepage":"https://github.com/0bipinnata0/heap","repository":{"type":"git","url":"git+https://github.com/0bipinnata0/heap.git"},"bugs":{"url":"https://github.com/0bipinnata0/heap/issues"},"devDependencies":{"@types/node":"^22.13.9","@vitest/coverage-v8":"^3.0.7","tsup":"^8.4.0","typescript":"^5.8.2","vitest":"^3.0.7"},"scripts":{"build":"tsup","test":"vitest","test:coverage":"vitest run --coverage"},"_id":"@0bipinnata0/heap@1.0.3","_integrity":"sha512-Bw0dHy8+EmJZCfTZNnOBtA2aMX25olKMWA/u6SoEEFv2MHOOftEDo1Oek2izZLIsjOBW4NdhXbBNG894xaA+dA==","_resolved":"/tmp/4754a595d13b9fb6c999dca1bd9497fa/0bipinnata0-heap-1.0.3.tgz","_from":"file:0bipinnata0-heap-1.0.3.tgz","_nodeVersion":"20.18.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Bw0dHy8+EmJZCfTZNnOBtA2aMX25olKMWA/u6SoEEFv2MHOOftEDo1Oek2izZLIsjOBW4NdhXbBNG894xaA+dA==","shasum":"e8d22772c55302e92b00a70b6cd4043abdad27cc","tarball":"https://registry.npmjs.org/@0bipinnata0/heap/-/heap-1.0.3.tgz","fileCount":9,"unpackedSize":13081,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBOmUxkb6h6sp+RfENfpExyT6JlFAFEcdgj1qXsIK/YfAiEAmSEZ/HQ1OCQZQKPJ6zFVMye3JwSQGhXO1SXqw4TjDto="}]},"_npmUser":{"name":"0bipinnata0","email":"odinzero@outlook.com"},"directories":{},"maintainers":[{"name":"0bipinnata0","email":"odinzero@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/heap_1.0.3_1741090700859_0.6533810132261817"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-04T10:52:25.779Z","modified":"2025-03-04T12:18:21.213Z","1.0.0":"2025-03-04T10:52:26.297Z","1.0.1":"2025-03-04T12:10:41.922Z","1.0.2":"2025-03-04T12:17:20.980Z","1.0.3":"2025-03-04T12:18:21.031Z"},"author":{"name":"0bipinnata0"},"license":"MIT","keywords":["heap","min-heap","data-structure","typescript"],"description":"A TypeScript implementation of a min heap data structure","maintainers":[{"name":"0bipinnata0","email":"odinzero@outlook.com"}],"readme":"# @0bipinnata0/heap\n\nA high-performance TypeScript implementation of a min heap data structure that supports both ESM and CommonJS. This implementation is optimized for handling large datasets and provides stable ordering for elements with equal priorities.\n\n## Installation\n\n```bash\npnpm add @0bipinnata0/heap\n```\n\n## Features\n\n- 🚀 High performance implementation\n- 🔄 Stable ordering for equal priorities\n- 💪 Handles large datasets efficiently\n- 📦 Support for both ESM and CommonJS\n- 🎯 Type-safe with TypeScript\n- 🧪 Comprehensive test coverage\n\n## Usage\n\n```typescript\nimport { push, pop, peek } from '@0bipinnata0/heap'\n\n// Create a min heap array for objects with sortIndex\nconst heap: Array<{id: number, sortIndex: number}> = []\n\n// Push elements\npush(heap, { id: 1, sortIndex: 5 })\npush(heap, { id: 2, sortIndex: 3 })\npush(heap, { id: 3, sortIndex: 7 })\npush(heap, { id: 4, sortIndex: 1 })\n\n// Peek at minimum element without removing it\nconsole.log(peek(heap)) // { id: 4, sortIndex: 1 }\n\n// Pop elements in ascending order\nconsole.log(pop(heap)) // { id: 4, sortIndex: 1 }\nconsole.log(pop(heap)) // { id: 2, sortIndex: 3 }\nconsole.log(pop(heap)) // { id: 1, sortIndex: 5 }\nconsole.log(pop(heap)) // { id: 3, sortIndex: 7 }\n```\n\n## API\n\n### Functions\n\n- `push(heap: T[], value: T): void`\n  - Adds a new element to the heap\n  - Time complexity: O(log n)\n\n- `peek(heap: T[]): T | null`\n  - Returns the minimum element without removing it\n  - Returns null if heap is empty\n  - Time complexity: O(1)\n\n- `pop(heap: T[]): T | null`\n  - Removes and returns the minimum element\n  - Returns null if heap is empty\n  - Time complexity: O(log n)\n\n## Performance Characteristics\n\n- Push operation: O(log n)\n- Pop operation: O(log n)\n- Peek operation: O(1)\n- Space complexity: O(n)\n\n## Edge Cases Handling\n\n- Empty heap operations return null\n- Stable ordering for elements with equal priorities\n- Supports negative priority values\n- Handles very large priority values (up to Number.MAX_SAFE_INTEGER)\n\n## Use Cases\n\n- Priority queues\n- Task scheduling systems\n- Graph algorithms (Dijkstra's, Prim's)\n- Event scheduling\n- Real-time data processing\n\n## Testing\n\nThe package includes comprehensive test coverage for:\n- Basic operations (push, pop, peek)\n- Edge cases and boundary conditions\n- Performance with large datasets\n- Stability of ordering\n- Stress testing with random operations\n\nRun tests with:\n```bash\npnpm test\n```\n\n## License\n\nMIT","readmeFilename":"README.md","homepage":"https://github.com/0bipinnata0/heap","repository":{"type":"git","url":"git+https://github.com/0bipinnata0/heap.git"},"bugs":{"url":"https://github.com/0bipinnata0/heap/issues"}}