Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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,155,326 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.