Socket
Socket
Sign inDemoInstall

@types/d3-array

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-array - npm Package Compare versions

Comparing version 2.12.1 to 3.0.0

105

d3-array/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for D3JS d3-array module 2.12
// Type definitions for D3JS d3-array module 3.0
// Project: https://github.com/d3/d3-array, https://d3js.org/d3-array

@@ -11,3 +11,3 @@ // Definitions by: Alex Ford <https://github.com/gustavderdrache>

// Last module patch version validated against: 2.12.1
// Last module patch version validated against: 3.0.1

@@ -133,2 +133,19 @@ // --------------------------------------------------------------------------

/**
* Returns the mode of the given iterable, i.e. the value which appears the most often.
* In case of equality, returns the first of the relevant values.
* If the iterable contains no comparable values, returns undefined.
* An optional accessor function may be specified, which is equivalent to calling Array.from before computing the mode.
* This method ignores undefined, null and NaN values; this is useful for ignoring missing data.
*/
export function mode(iterable: Iterable<Numeric | undefined | null>): number;
/**
* Returns the mode of the given iterable, i.e. the value which appears the most often.
* In case of equality, returns the first of the relevant values.
* If the iterable contains no comparable values, returns undefined.
* An optional accessor function may be specified, which is equivalent to calling Array.from before computing the mode.
* This method ignores undefined, null and NaN values; this is useful for ignoring missing data.
*/
export function mode<T>(iterable: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number;
/**
* Compute the sum of an array of numbers.

@@ -459,3 +476,3 @@ */

key2: (value: TObject) => TKey2
): InternMap<TKey1, Map<TKey2, TObject[]>>;
): InternMap<TKey1, InternMap<TKey2, TObject[]>>;
/**

@@ -474,3 +491,3 @@ * Groups the specified array of values into an InternMap from key to array of value.

key3: (value: TObject) => TKey3
): InternMap<TKey1, Map<TKey2, Map<TKey3, TObject[]>>>;
): InternMap<TKey1, InternMap<TKey2, InternMap<TKey3, TObject[]>>>;

@@ -515,2 +532,39 @@ /**

/**
* Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps.
*
* @param iterable The array to group.
* @param key The key function.
*/
export function flatGroup<TObject, TKey>(
iterable: Iterable<TObject>,
key: (value: TObject) => TKey
): Array<[TKey, TObject[]]>;
/**
* Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps.
*
* @param iterable The array to group.
* @param key1 The first key function.
* @param key2 The second key function.
*/
export function flatGroup<TObject, TKey1, TKey2>(
iterable: Iterable<TObject>,
key1: (value: TObject) => TKey1,
key2: (value: TObject) => TKey2
): Array<[TKey1, TKey2, TObject[]]>;
/**
* Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps.
*
* @param iterable The array to group.
* @param key1 The first key function.
* @param key2 The second key function.
* @param key3 The third key function.
*/
export function flatGroup<TObject, TKey1, TKey2, TKey3>(
iterable: Iterable<TObject>,
key1: (value: TObject) => TKey1,
key2: (value: TObject) => TKey2,
key3: (value: TObject) => TKey3
): Array<[TKey1, TKey2, TKey3, TObject[]]>;
/**
* Equivalent to group but returns a unique value per compound key instead of an array, throwing if the key is not unique.

@@ -673,2 +727,45 @@ *

/**
* Equivalent to rollup, but returns a flat array of [key0, key1, …, value] instead of nested maps.
*
* @param iterable The array to group.
* @param reduce The reduce function.
* @param key The key function.
*/
export function flatRollup<TObject, TReduce, TKey>(
iterable: Iterable<TObject>,
reduce: (value: TObject[]) => TReduce,
key: (value: TObject) => TKey
): Array<[TKey, TReduce]>;
/**
* Equivalent to rollup, but returns a flat array of [key0, key1, …, value] instead of nested maps.
*
* @param iterable The array to group.
* @param reduce The reduce function.
* @param key1 The first key function.
* @param key2 The second key function.
*/
export function flatRollup<TObject, TReduce, TKey1, TKey2>(
iterable: Iterable<TObject>,
reduce: (value: TObject[]) => TReduce,
key1: (value: TObject) => TKey1,
key2: (value: TObject) => TKey2
): Array<[TKey1, TKey2, TReduce]>;
/**
* Equivalent to rollup, but returns a flat array of [key0, key1, …, value] instead of nested maps.
*
* @param iterable The array to group.
* @param reduce The reduce function.
* @param key1 The first key function.
* @param key2 The second key function.
* @param key3 The third key function.
*/
export function flatRollup<TObject, TReduce, TKey1, TKey2, TKey3>(
iterable: Iterable<TObject>,
reduce: (value: TObject[]) => TReduce,
key1: (value: TObject) => TKey1,
key2: (value: TObject) => TKey2,
key3: (value: TObject) => TKey3
): Array<[TKey1, TKey2, TKey3, TReduce]>;
/**
* Groups the specified iterable of elements according to the specified key function, sorts the groups according to the specified comparator, and then returns an array of keys in sorted order.

@@ -675,0 +772,0 @@ * The comparator will be asked to compare two groups a and b and should return a negative value if a should be before b, a positive value if a should be after b, or zero for a partial ordering.

7

d3-array/package.json
{
"name": "@types/d3-array",
"version": "2.12.1",
"version": "3.0.0",
"description": "TypeScript definitions for D3JS d3-array module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array",
"license": "MIT",

@@ -47,4 +48,4 @@ "contributors": [

"dependencies": {},
"typesPublisherContentHash": "03847d356a1ed569a84514b1a782e01976435add465b4133ac8df99cef77b499",
"typeScriptVersion": "3.5"
"typesPublisherContentHash": "101fe09ba06a59553b73eba435f288e5459089801cc4ebff1bc9ae39ef0cd3dc",
"typeScriptVersion": "3.6"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Sat, 22 May 2021 13:31:19 GMT
* Last updated: Fri, 18 Jun 2021 00:31:12 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: none

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