New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trie-prefix-tree

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trie-prefix-tree - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

8

dist/index.js

@@ -18,2 +18,10 @@ 'use strict';

/**
* Get the generated raw trie object
*/
tree: function tree() {
return trie;
},
/**
* Get a string representation of the trie

@@ -20,0 +28,0 @@ */

2

package.json
{
"name": "trie-prefix-tree",
"version": "1.4.0",
"version": "1.5.0",
"description": "Create and modify trie prefix structures, extract word lists including anagrams and sub-anagrams",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -86,2 +86,7 @@ # Trie Prefix Tree

```javascript
// retrieve the Trie object instance
myTrie.tree();
```
```javascript
// add a new word to the Trie

@@ -118,2 +123,8 @@ myTrie.addWord('lion');

myTrie.getPrefix('c'); // ['cat', 'cats']
// Pass false as the second parameter to disable
// output being sorted alphabetically
// this is useful when your dictionary is already sorted
// and will therefore save performance
myTrie.getPrefix('c', false); // ['cat', 'cats']
```

@@ -125,3 +136,9 @@

// retrieve a full list of words in the Trie
myTrie.getWords(); // ['cat', 'cats', 'elephant', 'lion', 'tiger'];
// the output array is automatically sorted
myTrie.getWords(); // ['cat', 'cats', 'elephant', 'lion', 'tiger']
// pass false to disable the output being sorted
// this is useful when your dictionary is already sorted
// and will therefore save performance
myTrie.getWords(false); // ['cat', 'cats', 'elephant', 'tiger', 'lion']
```

@@ -131,3 +148,3 @@

// check if a word exists in the Trie
myTrie.hasword('elephant'); // true
myTrie.hasWord('elephant'); // true
myTrie.hasWord('zoo'); // false

@@ -134,0 +151,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc