
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@datkt/flat-tree
Advanced tools
Kotlin port of @mafintosh's flat-tree functions to map a binary tree to a list.
Port of @mafintosh's flat-tree functions to map a binary tree to a list.
The datkt.flattree package an be installed with NPM.
$ npm install @datkt/flat-tree
konanc command line program.@datkt/konanc-config## Compile a program in 'main.kt' and link flat-tree libraries found in `node_modules/`
$ konanc main.kt $(konanc-config -clr @datkt/flat-tree) -o main.kexe
$ ./main.kexe
where main.kt might be
import datkt.flattree.*
fun main(args: Array<String>) {
val tree = Tree()
tree.parent(0L, null) // 1L
tree.parent(2L, null) // 1L
tree.parent(1L, null) // 3L
}
index = ftIndex(depth: Long, offset: Long): LongReturns an array index for the tree element at the given depth and offset
parentIndex = tree.parent(index: Long, depth: Long?): LongReturns the index of the parent element in tree
siblingIndex = tree.sibling(index: Long, depth: Long?): LongReturns the index of this elements sibling
children = tree.children(index: Long, depth: Long?): Array<Long>Returns an array [leftChild, rightChild] with the indexes of this elements children.
If this element does not have any children it returns null
range = tree.spans(index: Long, depth: Long?): Array<Long>Returns the range (inclusive) the tree root at index spans.
For example tree.spans(3) would return [0, 6] (see the usage example).
index = tree.leftSpan(index: Long, depth: Long?): LongReturns the left spanning in index in the tree index spans.
index = tree.rightSpan(index: Long, depth: Long?): LongReturns the right spanning in index in the tree index spans.
count = tree. count(index: Long, depth: Long?): LongReturns how many nodes (including parent nodes) a tree contains
depth = ftDepth(index: Long): LongReturns the depth of an element
offset = ftOffset(index: Long, depth: Long?): LongReturns the relative offset of an element
roots = tree.fullRoots(index: Long, result: Array<Long>?): Array<Long>Returns a list of all the full roots (subtrees where all nodes have either 2 or 0 children) < index.
For example fullRoots(8) returns [3] since the subtree rooted at 3 spans 0 -> 6 and the tree
rooted at 7 has a child located at 9 which is >= 8.
index = iterator.next(): LongMove the iterator the next item in the tree.
index = iterator.prev(): LongMove the iterator the prev item in the tree.
iterator.seek(index: Long)Move the iterator the this specific tree index.
index = iterator.parent(): LongMove the iterator to the current parent index
index = iterator.leftChild(): LongMove the iterator to the current left child index.
index = iterator.rightChild(): LongMove the iterator to the current right child index.
index = iterator.leftSpan(): LongMove the iterator to the current left span index.
index = iterator.rightSpan(): LongMove the iterator to the current right span index.
bool = iterator.isLeft(): BooleanIs the iterator at a left sibling?
bool = iterator.isRight(): BooleanIs the iterator at a right sibling?
index = iterator.sibling(): LongMove the iterator to the current sibling
MIT
FAQs
Kotlin port of @mafintosh's flat-tree functions to map a binary tree to a list.
The npm package @datkt/flat-tree receives a total of 4 weekly downloads. As such, @datkt/flat-tree popularity was classified as not popular.
We found that @datkt/flat-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.