Socket
Socket
Sign inDemoInstall

@datastructures-js/trie

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.1.0

src/trie.d.ts

5

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## [4.1.0] - 2021-06-20
### Added
- typescript.
## [4.0.1] - 2021-02-25

@@ -11,0 +16,0 @@

4

index.js

@@ -1,5 +0,5 @@

const Trie = require('./src/trie');
const TrieNode = require('./src/trieNode');
const { Trie } = require('./src/trie');
const { TrieNode } = require('./src/trieNode');
exports.TrieNode = TrieNode
exports.Trie = Trie;
{
"name": "@datastructures-js/trie",
"version": "4.0.1",
"version": "4.1.0",
"description": "trie implementation in javascript",

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

@@ -9,2 +9,4 @@ # @datastructures-js/trie

<img src="https://user-images.githubusercontent.com/6517308/121813242-859a9700-cc6b-11eb-99c0-49e5bb63005b.jpg">
<table>

@@ -16,3 +18,3 @@ <tr><th>Trie</th></tr>

# Table of Contents
# Contents
* [Install](#install)

@@ -22,3 +24,3 @@ * [require](#require)

* [API](#api)
* [Construction](#construction)
* [constructor](#constructor)
* [.insert(value)](#insertvalue)

@@ -58,3 +60,3 @@ * [.has(value)](#hasvalue)

### Construction
### constructor

@@ -77,3 +79,3 @@ ```js

<tr>
<td align="center">value: any</td>
<td align="center">value: { toString: () => string }</td>
<td align="center">Trie</td>

@@ -106,3 +108,3 @@ <td align="center">O(k): k = length of string value</td>

<tr>
<td align="center">value: any</td>
<td align="center">value: { toString: () => string }</td>
<td align="center">boolean</td>

@@ -128,3 +130,3 @@ <td align="center">O(k): k = length of string value</td>

<tr>
<td align="center">value: any</td>
<td align="center">value: { toString: () => string }</td>
<td align="center">TrieNode</td>

@@ -158,3 +160,3 @@ <td align="center">O(k): k = length of string value</td>

<tr>
<td align="center">value: any</td>
<td align="center">value: { toString: () => string }</td>
<td align="center">string: the removed word</td>

@@ -181,3 +183,3 @@ <td align="center">O(k): k = length of string value</td>

<tr>
<td align="center">cb: function</td>
<td align="center">cb: (word: string) => void</td>
<td align="center">O(n): n = number of nodes in the trie</td>

@@ -210,3 +212,3 @@ </tr>

<tr>
<td align="center">array&lt;string&gt;</td>
<td align="center">string[]</td>
<td align="center">O(n): n = number of nodes in the trie</td>

@@ -286,3 +288,3 @@ </tr>

<tr>
<td>list: array&lt;any&gt;</td>
<td>list: string[]</td>
<td>boolean</td>

@@ -331,7 +333,7 @@ <td>O(n * k)</td>

#### .setParent(trieNode)
#### .setParent(parent)
<table>
<tr><th>params</th></tr>
<tr><td>trieNode: TrieNode</td></tr>
<tr><th>params</th><th>return</th></tr>
<tr><td>parent: TrieNode</td><td>TrieNode</td></tr>
</table>

@@ -349,4 +351,5 @@

<table>
<tr><th>params</th></tr>
<tr><td>isEndOfWord: boolean</td></tr>
<tr><th>params</th><th>return</th></tr>
<tr><td>isEndOfWord: boolean</td>
<td>TrieNode</td></tr>
</table>

@@ -353,0 +356,0 @@

@@ -7,3 +7,3 @@ /**

const TrieNode = require('./trieNode');
const { TrieNode } = require('./trieNode');

@@ -216,2 +216,2 @@ /**

module.exports = Trie;
exports.Trie = Trie;

@@ -34,2 +34,3 @@ /**

this._parent = parentNode;
return this;
}

@@ -51,2 +52,3 @@

this._isEndOfWord = isEndOfWord;
return this;
}

@@ -70,2 +72,3 @@

this._children.set(char, childNode);
return this;
}

@@ -117,2 +120,2 @@

module.exports = TrieNode;
exports.TrieNode = TrieNode;
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc