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.47.1 to 1.47.2

27

dist/data-structures/hash/hash-map.d.ts

@@ -138,4 +138,31 @@ /**

forEach(callback: (element: [K, V], index: number, hashMap: HashMap<K, V>) => void): void;
/**
* The `filter` function takes a predicate function and returns a new HashMap containing only the
* key-value pairs that satisfy the predicate.
* @param predicate - The `predicate` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object that contains the key-value pairs from the original HashMap that
* satisfy the given predicate function.
*/
filter(predicate: (element: [K, V], map: HashMap<K, V>) => boolean): HashMap<K, V>;
/**
* The `map` function takes a callback function and returns a new HashMap with the values transformed
* by the callback.
* @param callback - The `callback` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object with the values mapped according to the provided callback function.
*/
map<NV>(callback: (element: [K, V], map: HashMap<K, V>) => NV): HashMap<K, NV>;
/**
* The `reduce` function iterates over the elements of a HashMap and applies a callback function to
* each element, accumulating a single value.
* @param callback - The callback parameter is a function that takes three arguments: accumulator,
* element, and map. It is called for each element in the HashMap and is used to accumulate a single
* result.
* @param {A} initialValue - The `initialValue` parameter is the initial value of the accumulator. It
* is the value that will be passed as the first argument to the `callback` function when reducing
* the elements of the map.
* @returns The `reduce` function is returning the final value of the accumulator after iterating
* over all the elements in the HashMap and applying the callback function to each element.
*/
reduce<A>(callback: (accumulator: A, element: [K, V], map: HashMap<K, V>) => A, initialValue: A): A;

@@ -142,0 +169,0 @@ /**

@@ -280,2 +280,10 @@ "use strict";

}
/**
* The `filter` function takes a predicate function and returns a new HashMap containing only the
* key-value pairs that satisfy the predicate.
* @param predicate - The `predicate` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object that contains the key-value pairs from the original HashMap that
* satisfy the given predicate function.
*/
filter(predicate) {

@@ -290,2 +298,9 @@ const filteredMap = new HashMap();

}
/**
* The `map` function takes a callback function and returns a new HashMap with the values transformed
* by the callback.
* @param callback - The `callback` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object with the values mapped according to the provided callback function.
*/
map(callback) {

@@ -299,2 +314,14 @@ const mappedMap = new HashMap();

}
/**
* The `reduce` function iterates over the elements of a HashMap and applies a callback function to
* each element, accumulating a single value.
* @param callback - The callback parameter is a function that takes three arguments: accumulator,
* element, and map. It is called for each element in the HashMap and is used to accumulate a single
* result.
* @param {A} initialValue - The `initialValue` parameter is the initial value of the accumulator. It
* is the value that will be passed as the first argument to the `callback` function when reducing
* the elements of the map.
* @returns The `reduce` function is returning the final value of the accumulator after iterating
* over all the elements in the HashMap and applying the callback function to each element.
*/
reduce(callback, initialValue) {

@@ -301,0 +328,0 @@ let accumulator = initialValue;

4

package.json
{
"name": "directed-graph-typed",
"version": "1.47.1",
"version": "1.47.2",
"description": "Directed Graph. Javascript & Typescript Data Structure.",

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

"dependencies": {
"data-structure-typed": "^1.47.1"
"data-structure-typed": "^1.47.2"
}
}

@@ -308,2 +308,10 @@ /**

/**
* The `filter` function takes a predicate function and returns a new HashMap containing only the
* key-value pairs that satisfy the predicate.
* @param predicate - The `predicate` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object that contains the key-value pairs from the original HashMap that
* satisfy the given predicate function.
*/
filter(predicate: (element: [K, V], map: HashMap<K, V>) => boolean): HashMap<K, V> {

@@ -319,2 +327,9 @@ const filteredMap = new HashMap<K, V>();

/**
* The `map` function takes a callback function and returns a new HashMap with the values transformed
* by the callback.
* @param callback - The `callback` parameter is a function that takes two arguments: `element` and
* `map`.
* @returns a new HashMap object with the values mapped according to the provided callback function.
*/
map<NV>(callback: (element: [K, V], map: HashMap<K, V>) => NV): HashMap<K, NV> {

@@ -329,2 +344,14 @@ const mappedMap = new HashMap<K, NV>();

/**
* The `reduce` function iterates over the elements of a HashMap and applies a callback function to
* each element, accumulating a single value.
* @param callback - The callback parameter is a function that takes three arguments: accumulator,
* element, and map. It is called for each element in the HashMap and is used to accumulate a single
* result.
* @param {A} initialValue - The `initialValue` parameter is the initial value of the accumulator. It
* is the value that will be passed as the first argument to the `callback` function when reducing
* the elements of the map.
* @returns The `reduce` function is returning the final value of the accumulator after iterating
* over all the elements in the HashMap and applying the callback function to each element.
*/
reduce<A>(callback: (accumulator: A, element: [K, V], map: HashMap<K, V>) => A, initialValue: A): A {

@@ -331,0 +358,0 @@ let accumulator = initialValue;

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