@rimbu/collection-types
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -267,4 +267,4 @@ import type { Token } from '@rimbu/base'; | ||
*/ | ||
addEntries(entries: StreamSource.NonEmpty<readonly [K, V]>): WithKeyValue<Tp, K, V>['nonEmpty']; | ||
addEntries(entries: StreamSource<readonly [K, V]>): WithKeyValue<Tp, K, V>['normal']; | ||
addEntries<V2 extends V = V>(entries: StreamSource.NonEmpty<readonly [K, V2]>): WithKeyValue<Tp, K, V>['nonEmpty']; | ||
addEntries<V2 extends V = V>(entries: StreamSource<readonly [K, V2]>): WithKeyValue<Tp, K, V>['normal']; | ||
/** | ||
@@ -412,2 +412,3 @@ * Returns the collection with the given `atKey` key modified according to given `options`. | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @param fillValue - the value to use for the result tuple if a source does not have a certain key | ||
@@ -417,3 +418,3 @@ * @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.mergeAll('none', [[2, true]], HashMap.of([3, 15])) | ||
* const m2 = HashMap.mergeAll('none', m, [[2, true]], HashMap.of([3, 15])) | ||
* // type of m2: HashMap<number, [string, boolean | string, number | string]> | ||
@@ -437,13 +438,19 @@ * console.log(m2.toArray()) | ||
* the given tuple will be filled with the given `fillValue`. | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @typeparam O - the type of the fill value | ||
* @typeparam I - the array of input source value types | ||
* @typeparam R - the resulting Map value type | ||
* @param fillValue - the value to use for the result tuple if a source does not have a certain key | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @param mergeFun - a function that receives each key of the given sources and, if present, the corresponding source values, or the given fill value otherwise, | ||
* and returns the result value to use in the resulting map. | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.mergeAllWith( | ||
* 'q', | ||
* (key, v1, v2, v3) => `${key}${v1}${v2}${v3}`, | ||
* const m2 = HashMap.mergeAllWith( | ||
* m | ||
* [[2, 'c']], | ||
* HashMap.of([3, 'd']) | ||
* )( | ||
* 'q', | ||
* (key, v1, v2, v3) => `${key}${v1}${v2}${v3}` | ||
* ) | ||
@@ -469,6 +476,7 @@ * // type of m2: HashMap<number, string> | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.merge([[2, true]], HashMap.of([2, 15])) | ||
* const m2 = HashMap.merge(m, [[2, true]], HashMap.of([2, 15])) | ||
* // type of m2: HashMap<number, [string, boolean, number]> | ||
@@ -493,11 +501,15 @@ * console.log(m2.toArray()) | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @typeparam R - the resulting Map value type | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @param mergeFun - a function taking the key and values from this map and all sources corresponding to the key, and | ||
* returning a value for the resulting Map. | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.merge( | ||
* (key, v1, v2) => `${key}${v1}${v2}`, | ||
* const m2 = HashMap.mergeWith( | ||
* m, | ||
* [[2, true]], | ||
* HashMap.of([2, 15]) | ||
* )( | ||
* (key, v1, v2) => `${key}${v1}${v2}`, | ||
* ) | ||
@@ -504,0 +516,0 @@ * // type of m2: HashMap<number, string> |
{ | ||
"name": "@rimbu/collection-types", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "Type definitions for the basic generic Rimbu collections", | ||
@@ -55,5 +55,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/base": "^0.7.0", | ||
"@rimbu/common": "^0.8.0", | ||
"@rimbu/stream": "^0.8.0", | ||
"@rimbu/base": "^0.7.1", | ||
"@rimbu/common": "^0.8.1", | ||
"@rimbu/stream": "^0.8.1", | ||
"tslib": "^2.3.1" | ||
@@ -67,3 +67,3 @@ }, | ||
}, | ||
"gitHead": "c321aa32b1c5fd8ca8b7fb1c26bd4f7bbf3ef70d" | ||
"gitHead": "d507e628ab82d501bc31351d69168e09bac5ae14" | ||
} |
@@ -301,7 +301,7 @@ import type { Token } from '@rimbu/base'; | ||
*/ | ||
addEntries( | ||
entries: StreamSource.NonEmpty<readonly [K, V]> | ||
addEntries<V2 extends V = V>( | ||
entries: StreamSource.NonEmpty<readonly [K, V2]> | ||
): WithKeyValue<Tp, K, V>['nonEmpty']; | ||
addEntries( | ||
entries: StreamSource<readonly [K, V]> | ||
addEntries<V2 extends V = V>( | ||
entries: StreamSource<readonly [K, V2]> | ||
): WithKeyValue<Tp, K, V>['normal']; | ||
@@ -481,2 +481,3 @@ /** | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @param fillValue - the value to use for the result tuple if a source does not have a certain key | ||
@@ -486,3 +487,3 @@ * @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.mergeAll('none', [[2, true]], HashMap.of([3, 15])) | ||
* const m2 = HashMap.mergeAll('none', m, [[2, true]], HashMap.of([3, 15])) | ||
* // type of m2: HashMap<number, [string, boolean | string, number | string]> | ||
@@ -516,13 +517,19 @@ * console.log(m2.toArray()) | ||
* the given tuple will be filled with the given `fillValue`. | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @typeparam O - the type of the fill value | ||
* @typeparam I - the array of input source value types | ||
* @typeparam R - the resulting Map value type | ||
* @param fillValue - the value to use for the result tuple if a source does not have a certain key | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @param mergeFun - a function that receives each key of the given sources and, if present, the corresponding source values, or the given fill value otherwise, | ||
* and returns the result value to use in the resulting map. | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.mergeAllWith( | ||
* 'q', | ||
* (key, v1, v2, v3) => `${key}${v1}${v2}${v3}`, | ||
* const m2 = HashMap.mergeAllWith( | ||
* m | ||
* [[2, 'c']], | ||
* HashMap.of([3, 'd']) | ||
* )( | ||
* 'q', | ||
* (key, v1, v2, v3) => `${key}${v1}${v2}${v3}` | ||
* ) | ||
@@ -560,6 +567,7 @@ * // type of m2: HashMap<number, string> | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.merge([[2, true]], HashMap.of([2, 15])) | ||
* const m2 = HashMap.merge(m, [[2, true]], HashMap.of([2, 15])) | ||
* // type of m2: HashMap<number, [string, boolean, number]> | ||
@@ -584,11 +592,15 @@ * console.log(m2.toArray()) | ||
* @typeparam I - the array of input source value types | ||
* @typeparam K - the common key type | ||
* @typeparam R - the resulting Map value type | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @param mergeFun - a function taking the key and values from this map and all sources corresponding to the key, and | ||
* returning a value for the resulting Map. | ||
* @param sources - a non-empty set of StreamSouces containing tuples of keys and values | ||
* @example | ||
* const m = HashMap.of([1, 'a'], [2, 'b']) | ||
* const m2 = m.merge( | ||
* (key, v1, v2) => `${key}${v1}${v2}`, | ||
* const m2 = HashMap.mergeWith( | ||
* m, | ||
* [[2, true]], | ||
* HashMap.of([2, 15]) | ||
* )( | ||
* (key, v1, v2) => `${key}${v1}${v2}`, | ||
* ) | ||
@@ -595,0 +607,0 @@ * // type of m2: HashMap<number, string> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189372
4038
Updated@rimbu/base@^0.7.1
Updated@rimbu/common@^0.8.1
Updated@rimbu/stream@^0.8.1