Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
The @wry/trie package is a library for creating and manipulating trie data structures in JavaScript. A trie, also known as a prefix tree, is a type of search tree that is used to store a dynamic set or associative array where the keys are usually strings. It is particularly useful for tasks like autocomplete, spell checking, and prefix matching.
Creating a Trie
This feature allows you to create a new Trie instance and insert strings into it. You can then find all strings that start with a given prefix.
{"import { Trie } from '@wry/trie';
const trie = new Trie();
trie.insert('hello');
trie.insert('world');
trie.insert('help');
console.log(trie.find('hel')); // ['hello', 'help']
console.log(trie.find('world')); // ['world']"}
Checking for Existence
This feature allows you to check if a particular string exists in the trie.
{"import { Trie } from '@wry/trie';
const trie = new Trie();
trie.insert('hello');
trie.insert('world');
console.log(trie.has('hello')); // true
console.log(trie.has('bye')); // false"}
Removing Entries
This feature allows you to remove entries from the trie.
{"import { Trie } from '@wry/trie';
const trie = new Trie();
trie.insert('hello');
trie.insert('world');
trie.remove('hello');
console.log(trie.has('hello')); // false
console.log(trie.has('world')); // true"}
The trie-search package is another implementation of a trie data structure for JavaScript. It offers similar functionalities for adding and searching words in a trie. It also allows for customizing the key on which the trie is built and supports wildcard searches.
This package implements a ternary search trie, which is a type of trie that can have better performance for certain datasets or use cases. It is similar to @wry/trie in that it is used for storing strings and performing prefix searches, but the underlying data structure and performance characteristics may differ.
A trie data structure that holds
object keys weakly, yet can also hold non-object keys, unlike WeakMap
.
FAQs
https://en.wikipedia.org/wiki/Trie
The npm package @wry/trie receives a total of 4,275,450 weekly downloads. As such, @wry/trie popularity was classified as popular.
We found that @wry/trie 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.