Socket
Socket
Sign inDemoInstall

directed-graph-typed

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directed-graph-typed - npm Package Compare versions

Comparing version 1.38.8 to 1.38.9

3

dist/data-structures/trie/trie.d.ts

@@ -80,6 +80,7 @@ /**

* @param {number} max - The max count of words will be found
* @param isAllWhenEmptyPrefix - If true, when the prefix provided as '', returns all the words in the trie.
* @returns {string[]} an array of strings.
*/
getWords(prefix?: string, max?: number): string[];
getWords(prefix?: string, max?: number, isAllWhenEmptyPrefix?: boolean): string[];
private _caseProcess;
}

@@ -229,5 +229,6 @@ "use strict";

* @param {number} max - The max count of words will be found
* @param isAllWhenEmptyPrefix - If true, when the prefix provided as '', returns all the words in the trie.
* @returns {string[]} an array of strings.
*/
getWords(prefix = '', max = Number.MAX_SAFE_INTEGER) {
getWords(prefix = '', max = Number.MAX_SAFE_INTEGER, isAllWhenEmptyPrefix = false) {
prefix = this._caseProcess(prefix);

@@ -258,3 +259,3 @@ const words = [];

}
if (startNode !== this.root)
if (isAllWhenEmptyPrefix || startNode !== this.root)
dfs(startNode, prefix);

@@ -261,0 +262,0 @@ return words;

{
"name": "directed-graph-typed",
"version": "1.38.8",
"version": "1.38.9",
"description": "Directed Graph. Javascript & Typescript Data Structure.",

@@ -149,4 +149,4 @@ "main": "dist/index.js",

"dependencies": {
"data-structure-typed": "^1.38.8"
"data-structure-typed": "^1.38.9"
}
}

@@ -118,3 +118,4 @@ /**

*/
export class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = BinaryTreeNode<V, BinaryTreeNodeNested<V>>> implements IBinaryTree<V, N> {
export class BinaryTree<V = any, N extends BinaryTreeNode<V, N> = BinaryTreeNode<V, BinaryTreeNodeNested<V>>>
implements IBinaryTree<V, N> {
/**

@@ -978,3 +979,2 @@ * Creates a new instance of BinaryTree.

}
}

@@ -981,0 +981,0 @@ }

@@ -27,3 +27,5 @@ /**

export class BST<V = any, N extends BSTNode<V, N> = BSTNode<V, BSTNodeNested<V>>> extends BinaryTree<V, N> implements IBinaryTree<V, N> {
export class BST<V = any, N extends BSTNode<V, N> = BSTNode<V, BSTNodeNested<V>>>
extends BinaryTree<V, N>
implements IBinaryTree<V, N> {
/**

@@ -30,0 +32,0 @@ * The constructor function initializes a binary search tree object with an optional comparator

@@ -22,3 +22,5 @@ import {BinaryTreeNodeKey, RBColor, RBTreeNodeNested, RBTreeOptions} from '../../types';

export class RBTree<V, N extends RBTreeNode<V, N> = RBTreeNode<V, RBTreeNodeNested<V>>> extends BST<V, N> implements IBinaryTree<V, N> {
export class RBTree<V, N extends RBTreeNode<V, N> = RBTreeNode<V, RBTreeNodeNested<V>>>
extends BST<V, N>
implements IBinaryTree<V, N> {
constructor(options?: RBTreeOptions) {

@@ -25,0 +27,0 @@ super(options);

@@ -244,5 +244,6 @@ /**

* @param {number} max - The max count of words will be found
* @param isAllWhenEmptyPrefix - If true, when the prefix provided as '', returns all the words in the trie.
* @returns {string[]} an array of strings.
*/
getWords(prefix = '', max = Number.MAX_SAFE_INTEGER): string[] {
getWords(prefix = '', max = Number.MAX_SAFE_INTEGER, isAllWhenEmptyPrefix = false): string[] {
prefix = this._caseProcess(prefix);

@@ -274,4 +275,5 @@ const words: string[] = [];

}
if (startNode !== this.root) dfs(startNode, prefix);
if (isAllWhenEmptyPrefix || startNode !== this.root) dfs(startNode, prefix);
return words;

@@ -278,0 +280,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