
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A tiny little heap implementation.
const tinyHeap = require("tinyHeap")
const minHeap = tinyHeap()
minHeap.push(3)
minHeap.push(2)
minHeap.push(1)
const top = minHeap.pop()
// 1
Initializes a new tiny heap.
The inOrder argument is a function used to compare parent nodes of the heap to keep it in order. The default value makes it a min-heap, like this:
const min = (parent, child) => {
return parent < child
}
min and max implementations are provided on tinyHeap:
const maxHeap = tinyHeap(tinyHeap.max)
maxHeap.push(1)
maxHeap.push(2)
maxHeap.push(3)
const top = maxHeap.pop()
// 3
Pushes a value onto the heap. It will be sifted into position using the inOrder function.
Pops the top value of the heap. For a min-heap this will be the min value. For a max-heap it'll be the max value.
Gets the top value of the heap without popping it. Useful if you need to compare before you pop.
Gets the number of nodes in the heap.
Returns all of the nodes of the heap as an array. Nodes are ordered top to bottom, left to right.
FAQs
A tiny little heap implementation.
The npm package tiny-heap receives a total of 3 weekly downloads. As such, tiny-heap popularity was classified as not popular.
We found that tiny-heap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.