Socket
Socket
Sign inDemoInstall

data-structure-typed

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-structure-typed - npm Package Compare versions

Comparing version 1.19.6 to 1.19.7

7

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

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

/**
* The function is a constructor for a class that initializes a priority callback function based on the
* options provided.
* The constructor function initializes a priority queue with an optional priority extractor function.
* @param [options] - An optional object that contains configuration options for the Heap.

@@ -69,4 +68,4 @@ */

/**
* The function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The parameter `node` can be of type `T` or `HeapItem<T>`.
* The `has` function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The `node` parameter can be of type `T` or `HeapItem<T>`.
* @returns a boolean value.

@@ -73,0 +72,0 @@ */

@@ -32,4 +32,3 @@ "use strict";

/**
* The function is a constructor for a class that initializes a priority callback function based on the
* options provided.
* The constructor function initializes a priority queue with an optional priority extractor function.
* @param [options] - An optional object that contains configuration options for the Heap.

@@ -70,4 +69,10 @@ */

/**
* The `peek` function returns the top item in the priority queue without removing it.
* @returns The `peek()` method is returning either a `HeapItem<T>` object or `null`.Returns an val with the highest priority in the queue
* The `peek` function returns the top item or value in a priority queue, depending on the value of the `isItem`
* parameter.
* @param {boolean} [isItem] - The `isItem` parameter is an optional boolean parameter that determines whether the
* method should return the entire `HeapItem` object or just the value of the item. If `isItem` is set to `true`, the
* method will return the `HeapItem` object. If `isItem`
* @returns The `peek` method returns either a `HeapItem<T>` object, `null`, `T`, or `undefined`. The specific return
* type depends on the value of the `isItem` parameter. If `isItem` is `true`, then the method returns a `HeapItem<T>`
* object or `null` if the heap is empty. If `isItem` is `false`
*/

@@ -80,4 +85,10 @@ peek(isItem) {

/**
* The `peekLast` function returns the last item in the heap.
* @returns The method `peekLast()` returns either a `HeapItem<T>` object or `null`.Returns an val with the lowest priority in the queue
* The `peekLast` function returns the last item in the heap, either as a `HeapItem` object or just the value depending
* on the `isItem` parameter.
* @param {boolean} [isItem] - A boolean parameter that indicates whether the method should return the HeapItem object
* or just the value of the last item in the heap. If isItem is true, the method will return the HeapItem object. If
* isItem is false or not provided, the method will return the value of the last item
* @returns The method `peekLast` returns either a `HeapItem<T>` object, `null`, `T`, or `undefined`. The specific
* return type depends on the value of the `isItem` parameter. If `isItem` is `true`, then the method returns a
* `HeapItem<T>` object or `null` if there are no items in the heap. If `isItem`
*/

@@ -105,4 +116,9 @@ peekLast(isItem) {

/**
* The `poll` function returns the top item from a priority queue or null if the queue is empty.Removes and returns an val with the highest priority in the queue
* @returns either a HeapItem<T> object or null.
* The `poll` function returns the top item from a priority queue, either as a HeapItem object or its value, depending
* on the value of the `isItem` parameter.
* @param {boolean} [isItem] - The `isItem` parameter is a boolean flag that indicates whether the returned value
* should be a `HeapItem<T>` object or just the value `T` itself. If `isItem` is `true`, the method will return the
* `HeapItem<T>` object, otherwise it will return just
* @returns The function `poll` returns either a `HeapItem<T>` object, `null`, or `T` (the value of the `val` property
* of the `HeapItem<T>` object).
*/

@@ -118,4 +134,4 @@ poll(isItem) {

/**
* The function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The parameter `node` can be of type `T` or `HeapItem<T>`.
* The `has` function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The `node` parameter can be of type `T` or `HeapItem<T>`.
* @returns a boolean value.

@@ -134,4 +150,9 @@ */

/**
* The `toArray` function returns an array of `HeapItem<T>` objects.
* @returns An array of HeapItem<T> objects.Returns a sorted list of vals
* The `toArray` function returns an array of either HeapItem objects or their values, depending on the value of the
* `isItem` parameter.
* @param {boolean} [isItem] - isItem is an optional boolean parameter that determines whether the returned array
* should contain the HeapItem objects or just the values of the HeapItem objects. If isItem is true, the array will
* contain the HeapItem objects. If isItem is false or not provided, the array will contain only the values
* @returns The method `toArray` returns an array of `HeapItem<T>` objects, or an array of `T` values if the `isItem`
* parameter is set to `false`.
*/

@@ -138,0 +159,0 @@ toArray(isItem) {

{
"name": "data-structure-typed",
"version": "1.19.6",
"version": "1.19.7",
"description": "Javascript & TypeScript Data Structure Library, meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a wide range of data structures, such as Binary Tree, AVL Tree, Binary Search Tree (BST), Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed Graph, Undirected Graph, Singly Linked List, Hash, CoordinateSet, CoordinateMap, Heap, Doubly Linked List, Priority Queue, Max Priority Queue, Min Priority Queue, Queue, ObjectDeque, ArrayDeque, Stack, and Trie. Each data structure is thoughtfully designed and implemented using TypeScript to provide efficient, reliable, and easy-to-use solutions for your programming needs. Whether you're optimizing algorithms, managing data, or enhancing performance, our TypeScript Data Structure Library is your go-to resource. Elevate your coding experience with these fundamental building blocks for software development.",

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

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

return this._addVertexOnly(idOrVertex);
} else {

@@ -176,0 +175,0 @@ const newVertex = this.createVertex(idOrVertex, val);

@@ -47,5 +47,5 @@ /**

export abstract class Heap<T = number> {
/**
* The function is a constructor for a class that initializes a priority callback function based on the
* options provided.
* The constructor function initializes a priority queue with an optional priority extractor function.
* @param [options] - An optional object that contains configuration options for the Heap.

@@ -95,5 +95,12 @@ */

peek(isItem: true): HeapItem<T> | null;
/**
* The `peek` function returns the top item in the priority queue without removing it.
* @returns The `peek()` method is returning either a `HeapItem<T>` object or `null`.Returns an val with the highest priority in the queue
* The `peek` function returns the top item or value in a priority queue, depending on the value of the `isItem`
* parameter.
* @param {boolean} [isItem] - The `isItem` parameter is an optional boolean parameter that determines whether the
* method should return the entire `HeapItem` object or just the value of the item. If `isItem` is set to `true`, the
* method will return the `HeapItem` object. If `isItem`
* @returns The `peek` method returns either a `HeapItem<T>` object, `null`, `T`, or `undefined`. The specific return
* type depends on the value of the `isItem` parameter. If `isItem` is `true`, then the method returns a `HeapItem<T>`
* object or `null` if the heap is empty. If `isItem` is `false`
*/

@@ -109,5 +116,12 @@ peek(isItem?: boolean): HeapItem<T> | null | T | undefined {

peekLast(isItem: true): HeapItem<T> | null;
/**
* The `peekLast` function returns the last item in the heap.
* @returns The method `peekLast()` returns either a `HeapItem<T>` object or `null`.Returns an val with the lowest priority in the queue
* The `peekLast` function returns the last item in the heap, either as a `HeapItem` object or just the value depending
* on the `isItem` parameter.
* @param {boolean} [isItem] - A boolean parameter that indicates whether the method should return the HeapItem object
* or just the value of the last item in the heap. If isItem is true, the method will return the HeapItem object. If
* isItem is false or not provided, the method will return the value of the last item
* @returns The method `peekLast` returns either a `HeapItem<T>` object, `null`, `T`, or `undefined`. The specific
* return type depends on the value of the `isItem` parameter. If `isItem` is `true`, then the method returns a
* `HeapItem<T>` object or `null` if there are no items in the heap. If `isItem`
*/

@@ -139,5 +153,11 @@ peekLast(isItem?: boolean): HeapItem<T> | null | T | undefined {

poll(isItem: true): HeapItem<T> | null;
/**
* The `poll` function returns the top item from a priority queue or null if the queue is empty.Removes and returns an val with the highest priority in the queue
* @returns either a HeapItem<T> object or null.
* The `poll` function returns the top item from a priority queue, either as a HeapItem object or its value, depending
* on the value of the `isItem` parameter.
* @param {boolean} [isItem] - The `isItem` parameter is a boolean flag that indicates whether the returned value
* should be a `HeapItem<T>` object or just the value `T` itself. If `isItem` is `true`, the method will return the
* `HeapItem<T>` object, otherwise it will return just
* @returns The function `poll` returns either a `HeapItem<T>` object, `null`, or `T` (the value of the `val` property
* of the `HeapItem<T>` object).
*/

@@ -154,4 +174,4 @@ poll(isItem?: boolean): HeapItem<T> | null | T | undefined {

/**
* The function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The parameter `node` can be of type `T` or `HeapItem<T>`.
* The `has` function checks if a given node or value exists in the priority queue.
* @param {T | HeapItem<T>} node - The `node` parameter can be of type `T` or `HeapItem<T>`.
* @returns a boolean value.

@@ -172,5 +192,11 @@ */

toArray(isItem: true): (HeapItem<T> | null)[];
/**
* The `toArray` function returns an array of `HeapItem<T>` objects.
* @returns An array of HeapItem<T> objects.Returns a sorted list of vals
* The `toArray` function returns an array of either HeapItem objects or their values, depending on the value of the
* `isItem` parameter.
* @param {boolean} [isItem] - isItem is an optional boolean parameter that determines whether the returned array
* should contain the HeapItem objects or just the values of the HeapItem objects. If isItem is true, the array will
* contain the HeapItem objects. If isItem is false or not provided, the array will contain only the values
* @returns The method `toArray` returns an array of `HeapItem<T>` objects, or an array of `T` values if the `isItem`
* parameter is set to `false`.
*/

@@ -177,0 +203,0 @@ toArray(isItem?: boolean): (HeapItem<T> | null | T | undefined)[] {

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