mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45893 [@types/underscore] Collection and Array Tests - Reduce and ReduceRight by @reubenrybnik
* Updating type definitions for reduce and reduceRight and adding tests. * Adding defaults for V in memo iterators. * Updating a few tests to test constant memos more and omitted memos less. * Updating reduce and reduceRight undefined memo overloads to allow a different result type to be specified or inferred, adding undefined to the posible result of reduce calls, and adding tests around union-type results. * Making a few test changes to better illustrate the ways that a union result can be specified when calling reduce with no memo. * Rewriting the overloads of reduce and reduceRight that take an optional memo to take no memo since a memo that is explicitly provided as undefined will still be treated as the memo value to use instead of using the first item in the collection.. * Removing the undefined type from the result for overloads that take a memo since the result in such cases is the memo. * Breaking up tests for multiple aliases by alias.
This commit is contained in:
parent
7bd3a9ed10
commit
201779301e
263
types/underscore/index.d.ts
vendored
263
types/underscore/index.d.ts
vendored
@ -124,14 +124,19 @@ declare module _ {
|
||||
|
||||
type IterateePropertyShorthand = string | number;
|
||||
|
||||
interface MemoIterator<T, TResult> {
|
||||
(prev: TResult, curr: T, index: number, list: List<T>): TResult;
|
||||
interface MemoIterator<T, TResult, V = List<T>> {
|
||||
(prev: TResult, curr: T, index: number, list: V): TResult;
|
||||
}
|
||||
|
||||
interface MemoObjectIterator<T, TResult> {
|
||||
(prev: TResult, curr: T, key: string, list: Dictionary<T>): TResult;
|
||||
interface MemoObjectIterator<T, TResult, V = Dictionary<T>> {
|
||||
(prev: TResult, curr: T, key: string, object: V): TResult;
|
||||
}
|
||||
|
||||
type MemoCollectionIterator<T, TResult, V> =
|
||||
V extends List<T> ? MemoIterator<T, TResult, V>
|
||||
: V extends Dictionary<T> ? MemoObjectIterator<T, TResult, V>
|
||||
: never;
|
||||
|
||||
type TypeOfList<V> = V extends List<infer T> ? T : never;
|
||||
|
||||
type TypeOfDictionary<V> = V extends Dictionary<infer T> ? T : never;
|
||||
@ -234,76 +239,87 @@ declare module _ {
|
||||
collect: UnderscoreStatic['map'];
|
||||
|
||||
/**
|
||||
* Also known as inject and foldl, reduce boils down a list of values into a single value.
|
||||
* Memo is the initial state of the reduction, and each successive step of it should be
|
||||
* returned by iterator. The iterator is passed four arguments: the memo, then the value
|
||||
* and index (or key) of the iteration, and finally a reference to the entire list.
|
||||
* @param list Reduces the elements of this array.
|
||||
* @param iterator Reduce iterator function for each element in `list`.
|
||||
* @param memo Initial reduce state.
|
||||
* @param context `this` object in `iterator`, optional.
|
||||
* @return Reduced object result.
|
||||
**/
|
||||
reduce<T, TResult>(
|
||||
list: _.List<T>,
|
||||
iterator: _.MemoIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
|
||||
reduce<T, TResult>(
|
||||
list: _.Dictionary<T>,
|
||||
iterator: _.MemoObjectIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
* Also known as inject and foldl, reduce boils down a collection of values into a
|
||||
* single value. Memo is the initial state of the reduction, and each successive
|
||||
* step of it should be returned by iteratee. The iteratee is passed four arguments:
|
||||
* the memo, then the value and index (or key) of the iteration, and finally a reference
|
||||
* to the entire collection.
|
||||
*
|
||||
* If no memo is passed to the initial invocation of reduce, the iteratee is not invoked
|
||||
* on the first element of the collection. The first element is instead passed as the memo
|
||||
* in the invocation of the iteratee on the next element in the collection.
|
||||
* @param collection Reduces the elements of this collection.
|
||||
* @param iteratee Reduce iteratee function for each element in `collection`.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result.
|
||||
**/
|
||||
reduce<V extends List<any>, TResult>(
|
||||
collection: V,
|
||||
iteratee: MemoIterator<TypeOfList<V>, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduce<V extends Dictionary<any>, TResult>(
|
||||
collection: V,
|
||||
iteratee: MemoObjectIterator<TypeOfDictionary<V>, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduce<V extends List<any>, TResult = TypeOfList<V>>(
|
||||
collection: V,
|
||||
iteratee: MemoIterator<TypeOfList<V>, TResult | TypeOfList<V>, V>
|
||||
): TResult | TypeOfList<V> | undefined;
|
||||
reduce<V extends Dictionary<any>, TResult = TypeOfDictionary<V>>(
|
||||
collection: V,
|
||||
iteratee: MemoObjectIterator<TypeOfDictionary<V>, TResult | TypeOfDictionary<V>, V>
|
||||
): TResult | TypeOfDictionary<V> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
inject<T, TResult>(
|
||||
list: _.List<T>,
|
||||
iterator: _.MemoIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
|
||||
inject<T, TResult>(
|
||||
list: _.Dictionary<T>,
|
||||
iterator: _.MemoObjectIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
* @see reduce
|
||||
**/
|
||||
inject: UnderscoreStatic['reduce'];
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
foldl<T, TResult>(
|
||||
list: _.Collection<T>,
|
||||
iterator: _.MemoIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
* @see reduce
|
||||
**/
|
||||
foldl: UnderscoreStatic['reduce'];
|
||||
|
||||
/**
|
||||
* The right-associative version of reduce. Delegates to the JavaScript 1.8 version of
|
||||
* reduceRight, if it exists. `foldr` is not as useful in JavaScript as it would be in a
|
||||
* language with lazy evaluation.
|
||||
* @param list Reduces the elements of this array.
|
||||
* @param iterator Reduce iterator function for each element in `list`.
|
||||
* @param memo Initial reduce state.
|
||||
* @param context `this` object in `iterator`, optional.
|
||||
* @return Reduced object result.
|
||||
**/
|
||||
reduceRight<T, TResult>(
|
||||
list: _.Collection<T>,
|
||||
iterator: _.MemoIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
* The right-associative version of reduce.
|
||||
*
|
||||
* This is not as useful in JavaScript as it would be in a language with lazy evaluation.
|
||||
* @param collection Reduces the elements of this array.
|
||||
* @param iteratee Reduce iteratee function for each element in `collection`.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result.
|
||||
**/
|
||||
reduceRight<V extends List<any>, TResult>(
|
||||
collection: V,
|
||||
iteratee: MemoIterator<TypeOfList<V>, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduceRight<V extends Dictionary<any>, TResult>(
|
||||
collection: V,
|
||||
iteratee: MemoObjectIterator<TypeOfDictionary<V>, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduceRight<V extends List<any>, TResult = TypeOfList<V>>(
|
||||
collection: V,
|
||||
iteratee: MemoIterator<TypeOfList<V>, TResult | TypeOfList<V>, V>
|
||||
): TResult | TypeOfList<V> | undefined;
|
||||
reduceRight<V extends Dictionary<any>, TResult = TypeOfDictionary<V>>(
|
||||
collection: V,
|
||||
iteratee: MemoObjectIterator<TypeOfDictionary<V>, TResult | TypeOfDictionary<V>, V>
|
||||
): TResult | TypeOfDictionary<V> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.reduceRight
|
||||
**/
|
||||
foldr<T, TResult>(
|
||||
list: _.Collection<T>,
|
||||
iterator: _.MemoIterator<T, TResult>,
|
||||
memo?: TResult,
|
||||
context?: any): TResult;
|
||||
* @see reduceRight
|
||||
**/
|
||||
foldr: UnderscoreStatic['reduceRight'];
|
||||
|
||||
/**
|
||||
* Looks through each value in the list, returning the first one that passes a truth
|
||||
@ -4160,31 +4176,60 @@ declare module _ {
|
||||
collect: Underscore<T, V>['map'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): TResult;
|
||||
* Also known as inject and foldl, reduce boils down a collection of wrapped values into a
|
||||
* single value. Memo is the initial state of the reduction, and each successive
|
||||
* step of it should be returned by iteratee. The iteratee is passed four arguments:
|
||||
* the memo, then the value and index (or key) of the iteration, and finally a reference
|
||||
* to the entire collection.
|
||||
*
|
||||
* If no memo is passed to the initial invocation of reduce, the iteratee is not invoked
|
||||
* on the first element of the collection. The first element is instead passed as the memo
|
||||
* in the invocation of the iteratee on the next element in the collection.
|
||||
* @param iteratee Reduce iteratee function for each element in the wrapped collection.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result.
|
||||
**/
|
||||
reduce<TResult>(iteratee: MemoCollectionIterator<T, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduce<TResult = TypeOfCollection<V>>(
|
||||
iteratee: MemoCollectionIterator<T, TResult | TypeOfCollection<V>, V>
|
||||
): TResult | TypeOfCollection<V> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
* @see reduce
|
||||
**/
|
||||
inject<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): TResult;
|
||||
inject: Underscore<T, V>['reduce'];
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
* @see reduce
|
||||
**/
|
||||
foldl<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): TResult;
|
||||
foldl: Underscore<T, V>['reduce'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduceRight
|
||||
**/
|
||||
reduceRight<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): TResult;
|
||||
* The right-associative version of reduce.
|
||||
*
|
||||
* This is not as useful in JavaScript as it would be in a language with lazy evaluation.
|
||||
* @param iteratee Reduce iteratee function for each element in the wrapped collection.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result.
|
||||
**/
|
||||
reduceRight<TResult>(
|
||||
iteratee: MemoCollectionIterator<T, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): TResult;
|
||||
reduceRight<TResult = TypeOfCollection<V>>(
|
||||
iteratee: MemoCollectionIterator<T, TResult | TypeOfCollection<V>, V>
|
||||
): TResult | TypeOfCollection<V> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.reduceRight
|
||||
* @see reduceRight
|
||||
**/
|
||||
foldr<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): TResult;
|
||||
foldr: Underscore<T, V>['reduceRight'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
@ -5111,31 +5156,61 @@ declare module _ {
|
||||
collect: _Chain<T, V>['map'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
* Also known as inject and foldl, reduce boils down a collection of wrapped values into a
|
||||
* single value. Memo is the initial state of the reduction, and each successive
|
||||
* step of it should be returned by iteratee. The iteratee is passed four arguments:
|
||||
* the memo, then the value and index (or key) of the iteration, and finally a reference
|
||||
* to the entire collection.
|
||||
*
|
||||
* If no memo is passed to the initial invocation of reduce, the iteratee is not invoked
|
||||
* on the first element of the collection. The first element is instead passed as the memo
|
||||
* in the invocation of the iteratee on the next element in the collection.
|
||||
* @param iteratee Reduce iteratee function for each element in `list`.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result in a chain wraper.
|
||||
**/
|
||||
reduce<TResult>(
|
||||
iteratee: MemoCollectionIterator<T, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): _ChainSingle<TResult>;
|
||||
reduce<TResult = TypeOfCollection<V>>(
|
||||
iteratee: MemoCollectionIterator<T, TResult | TypeOfCollection<V>, V>
|
||||
): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
* @see reduce
|
||||
**/
|
||||
inject<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
inject: _Chain<T, V>['reduce'];
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
* @see reduce
|
||||
**/
|
||||
foldl<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
foldl: _Chain<T, V>['reduce'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduceRight
|
||||
**/
|
||||
reduceRight<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
* The right-associative version of reduce.
|
||||
*
|
||||
* This is not as useful in JavaScript as it would be in a language with lazy evaluation.
|
||||
* @param iteratee Reduce iteratee function for each element in the wrapped collection.
|
||||
* @param memo Initial reduce state or undefined to use the first collection item as initial state.
|
||||
* @param context `this` object in `iteratee`, optional.
|
||||
* @returns The reduced result in a chain wrapper.
|
||||
**/
|
||||
reduceRight<TResult>(
|
||||
iteratee: MemoCollectionIterator<T, TResult, V>,
|
||||
memo: TResult,
|
||||
context?: any
|
||||
): _ChainSingle<TResult>;
|
||||
reduceRight<TResult = TypeOfCollection<V>>(
|
||||
iteratee: MemoCollectionIterator<T, TResult | TypeOfCollection<V>, V>
|
||||
): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
|
||||
|
||||
/**
|
||||
* @see _.reduceRight
|
||||
* @see reduceRight
|
||||
**/
|
||||
foldr<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
foldr: _Chain<T, V>['reduceRight'];
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
|
||||
@ -12,13 +12,16 @@ _.map({ one: 1, two: 2, three: 3 }, (value, key) => value * 3);
|
||||
let plucked: string[] = _.map([{key: 'apples'}, {key: 'oranges'}], 'key');
|
||||
|
||||
//var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); // https://typescript.codeplex.com/workitem/1960
|
||||
var sum = _.reduce<number, number>([1, 2, 3], (memo, num) => memo + num, 0);
|
||||
sum = _.reduce<number, number>([1, 2, 3], (memo, num) => memo + num); // memo is optional #issue 5 github
|
||||
sum = _.reduce<string, number>({'a':'1', 'b':'2', 'c':'3'}, (memo, numstr) => memo + (+numstr));
|
||||
_.reduce([1, 2, 3], (memo, num) => memo + num); // $ExpectType number | undefined
|
||||
_.reduce<_.Dictionary<string>, number>({ 'a': '1', 'b': '2', 'c': '3' }, (memo, numstr) => (+memo) + (+numstr)); // $ExpectType string | number | undefined
|
||||
_.reduce({ 'a': '1', 'b': '2', 'c': '3' }, (memo: string | number, numstr) => (+memo) + (+numstr)); // $ExpectType string | number | undefined
|
||||
_.reduce([1, 2, 3], (memo, num) => memo + num, 0); // $ExpectType number
|
||||
_([1, 2, 3]).reduce((memo, num) => memo + num, 0); // $ExpectType number
|
||||
_.chain([1, 2, 3]).reduce((memo, num) => memo + num, 0).value(); // $ExpectType number
|
||||
|
||||
var list = [[0, 1], [2, 3], [4, 5]];
|
||||
//var flat = _.reduceRight(list, (a, b) => a.concat(b), []); // https://typescript.codeplex.com/workitem/1960
|
||||
var flat = _.reduceRight<number[], number[]>(list, (a, b) => a.concat(b), []);
|
||||
var flat = _.reduceRight(list, (a, b) => a.concat(b), [] as number[]);
|
||||
|
||||
namespace TestFind {
|
||||
let array: {a: string}[] = [{a: 'a'}, {a: 'b'}];
|
||||
@ -706,6 +709,9 @@ declare const maxLevel3RecordArray: (StringRecord | StringRecord[] | StringRecor
|
||||
|
||||
const stringRecordListValueIterator = (value: StringRecord, index: number, list: _.List<StringRecord>) => value.a;
|
||||
const stringRecordListBooleanIterator = (value: StringRecord, index: number, list: _.List<StringRecord>) => value.a === 'b';
|
||||
declare const stringRecordPartialMemoIterator: (prev: string, value: StringRecord) => string;
|
||||
declare const stringRecordListMemoIterator: (prev: string, value: StringRecord, index: number, list: _.List<StringRecord>) => string;
|
||||
declare const resultUnionPartialMemoIterator: (prev: string | StringRecord, value: StringRecord) => string | StringRecord;
|
||||
|
||||
interface StringRecordExplicitDictionary extends _.Dictionary<StringRecord> {
|
||||
a: StringRecord;
|
||||
@ -718,6 +724,7 @@ const stringRecordDictionary: _.Dictionary<StringRecord> = stringRecordExplicitD
|
||||
|
||||
const stringRecordDictionaryValueIterator = (element: StringRecord, key: string, dictionary: _.Dictionary<StringRecord>) => element.a;
|
||||
const stringRecordDictionaryBooleanIterator = (element: StringRecord, key: string, list: _.Dictionary<StringRecord>) => element.a === 'b';
|
||||
declare const stringRecordDictionaryMemoIterator: (prev: string, element: StringRecord, key: string, dictionary: _.Dictionary<StringRecord>) => string;
|
||||
|
||||
type StringRecordOrUndefined = StringRecord | undefined;
|
||||
|
||||
@ -747,8 +754,11 @@ const simpleStringArray: string[] = ['a', 'c'];
|
||||
const simpleStringList: _.List<string> = { 0: 'a', 1: 'c', length: 2 };
|
||||
declare const level2StringList: _.List<_.List<string>>;
|
||||
|
||||
const stringListValueIterator = (value: string, index: number, list: _.List<string>) => value.length;
|
||||
const stringListBooleanIterator = (value: string, index: number, list: _.List<string>) => value === 'b';
|
||||
const stringListValueIterator = (value: string, index: number, str: string) => value.length;
|
||||
const stringListBooleanIterator = (value: string, index: number, str: string) => value === 'b';
|
||||
declare const stringListSelfMemoIterator: (prev: string, value: string, index: number, str: string) => string;
|
||||
declare const stringListMemoIterator: (prev: _.Dictionary<number>, value: string, index: number, str: string) => _.Dictionary<number>;
|
||||
declare const resultUnionStringListMemoIterator: (prev: string | number, value: string, index: number, str: string) => string | number;
|
||||
|
||||
const simpleNumber = 7;
|
||||
|
||||
@ -777,186 +787,467 @@ declare const extractChainTypes: ChainTypeExtractor;
|
||||
|
||||
// map, collect
|
||||
{
|
||||
// function iteratee - lists
|
||||
// function iteratee - lists - map
|
||||
_.map(stringRecordList, stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
_(stringRecordList).map(stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordList).map(stringRecordListValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - lists - collect
|
||||
_.collect(stringRecordList, stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
_(stringRecordList).collect(stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordList).collect(stringRecordListValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - dictionaries
|
||||
// function iteratee - dictionaries - map
|
||||
_.map(stringRecordDictionary, stringRecordDictionaryValueIterator, context); // $ExpectType string[]
|
||||
_(stringRecordDictionary).map(stringRecordDictionaryValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).map(stringRecordDictionaryValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - dictionaries - collect
|
||||
_.collect(stringRecordDictionary, stringRecordDictionaryValueIterator, context); // $ExpectType string[]
|
||||
_(stringRecordDictionary).collect(stringRecordDictionaryValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).collect(stringRecordDictionaryValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - strings
|
||||
// function iteratee - strings - map
|
||||
_.map(simpleString, stringListValueIterator, context); // $ExpectType number[]
|
||||
_(simpleString).map(stringListValueIterator, context); // $ExpectType number[]
|
||||
extractChainTypes(_.chain(simpleString).map(stringListValueIterator, context)); // $ExpectType ChainType<number[], number>
|
||||
|
||||
// function iteratee - collect
|
||||
_.collect(simpleString, stringListValueIterator, context); // $ExpectType number[]
|
||||
_(simpleString).collect(stringListValueIterator, context); // $ExpectType number[]
|
||||
extractChainTypes(_.chain(simpleString).collect(stringListValueIterator, context)); // $ExpectType ChainType<number[], number>
|
||||
|
||||
// function iteratee - any
|
||||
// function iteratee - any - map
|
||||
_.map(anyValue, stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
_(anyValue).map(stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(anyValue).map(stringRecordListValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - any - collect
|
||||
_.collect(anyValue, stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
_(anyValue).collect(stringRecordListValueIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(anyValue).collect(stringRecordListValueIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// partial object iteratee - lists
|
||||
// partial object iteratee - lists - map
|
||||
_.map(stringRecordList, partialStringRecord); // $ExpectType boolean[]
|
||||
_(stringRecordList).map(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(stringRecordList).map(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// partial object iteratee - lists - collect
|
||||
_.collect(stringRecordList, partialStringRecord); // $ExpectType boolean[]
|
||||
_(stringRecordList).collect(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(stringRecordList).collect(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// partial object iteratee - dictionaries
|
||||
// partial object iteratee - dictionaries - map
|
||||
_.map(stringRecordDictionary, partialStringRecord); // $ExpectType boolean[]
|
||||
_(stringRecordDictionary).map(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).map(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// partial object iteratee - dictionaries - collect
|
||||
_.collect(stringRecordDictionary, partialStringRecord); // $ExpectType boolean[]
|
||||
_(stringRecordDictionary).collect(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).collect(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// partial object iteratee - any (see #33479)
|
||||
// partial object iteratee - any (see #33479) - map
|
||||
_.map(anyValue, partialStringRecord); // $ExpectType boolean[]
|
||||
_(anyValue).map(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(anyValue).map(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// partial object iteratee - any (see #33479) - collect
|
||||
_.collect(anyValue, partialStringRecord); // $ExpectType boolean[]
|
||||
_(anyValue).collect(partialStringRecord); // $ExpectType boolean[]
|
||||
extractChainTypes(_.chain(anyValue).collect(partialStringRecord)); // $ExpectType ChainType<boolean[], boolean>
|
||||
|
||||
// property name iteratee with a non-nullable single type - lists
|
||||
// property name iteratee with a non-nullable single type - lists - map
|
||||
_.map(stringRecordList, stringRecordProperty); // $ExpectType string[]
|
||||
_(stringRecordList).map(stringRecordProperty); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordList).map(stringRecordProperty)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// property name iteratee with a non-nullable single type - lists - collect
|
||||
_.collect(stringRecordList, stringRecordProperty); // $ExpectType string[]
|
||||
_(stringRecordList).collect(stringRecordProperty); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordList).collect(stringRecordProperty)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// property name iteratee with a non-nullable single type - dictionaries
|
||||
// property name iteratee with a non-nullable single type - dictionaries - map
|
||||
_.map(stringRecordDictionary, stringRecordProperty); // $ExpectType string[]
|
||||
_(stringRecordDictionary).map(stringRecordProperty); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).map(stringRecordProperty)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// property name iteratee with a non-nullable single type - dictionaries - collect
|
||||
_.collect(stringRecordDictionary, stringRecordProperty); // $ExpectType string[]
|
||||
_(stringRecordDictionary).collect(stringRecordProperty); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).collect(stringRecordProperty)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// property name iteratee with other types - lists
|
||||
// property name iteratee with other types - lists - map
|
||||
_.map(stringRecordOrUndefinedList, stringRecordProperty); // $ExpectType any[]
|
||||
_.map(intersectingPropertiesList, stringRecordProperty); // $ExpectType (string | boolean)[]
|
||||
_.map(nonIntersectingPropertiesList, stringRecordProperty); // $ExpectType any[]
|
||||
|
||||
// property name iteratee - any (see #33479)
|
||||
// property name iteratee with other types - lists - collect
|
||||
_.collect(stringRecordOrUndefinedList, stringRecordProperty); // $ExpectType any[]
|
||||
_.collect(intersectingPropertiesList, stringRecordProperty); // $ExpectType (string | boolean)[]
|
||||
_.collect(nonIntersectingPropertiesList, stringRecordProperty); // $ExpectType any[]
|
||||
|
||||
// property name iteratee - any (see #33479) - map
|
||||
_.map(anyValue, stringRecordProperty); // $ExpectType any[]
|
||||
_(anyValue).map(stringRecordProperty); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(anyValue).map(stringRecordProperty)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property name iteratee - any (see #33479) - collect
|
||||
_.collect(anyValue, stringRecordProperty); // $ExpectType any[]
|
||||
_(anyValue).collect(stringRecordProperty); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(anyValue).collect(stringRecordProperty)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - lists
|
||||
// property path iteratee - lists - map
|
||||
_.map(stringRecordList, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(stringRecordList).map(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(stringRecordList).map(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - lists - collect
|
||||
_.collect(stringRecordList, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(stringRecordList).collect(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(stringRecordList).collect(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - dictionaries
|
||||
// property path iteratee - dictionaries - map
|
||||
_.map(stringRecordDictionary, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(stringRecordDictionary).map(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).map(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - dictionaries - collect
|
||||
_.collect(stringRecordDictionary, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(stringRecordDictionary).collect(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).collect(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - any
|
||||
// property path iteratee - any - map
|
||||
_.map(anyValue, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(anyValue).map(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(anyValue).map(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
|
||||
// property path iteratee - any - collect
|
||||
_.collect(anyValue, stringRecordPropertyPath); // $ExpectType any[]
|
||||
_(anyValue).collect(stringRecordPropertyPath); // $ExpectType any[]
|
||||
extractChainTypes(_.chain(anyValue).collect(stringRecordPropertyPath)); // $ExpectType ChainType<any[], any>
|
||||
}
|
||||
|
||||
// reduce, foldl, inject
|
||||
{
|
||||
const stringMemo = '';
|
||||
const dictionaryMemo: _.Dictionary<number> = {};
|
||||
|
||||
// constant primitive memo and memo-type result - lists - reduce
|
||||
_.reduce(stringRecordList, stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_.reduce(stringRecordList, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordList).reduce(stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordList).reduce(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordList).reduce(stringRecordListMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordList).reduce(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - foldl
|
||||
_.foldl(stringRecordList, stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_.foldl(stringRecordList, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordList).foldl(stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordList).foldl(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordList).foldl(stringRecordListMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordList).foldl(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - inject
|
||||
_.inject(stringRecordList, stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_.inject(stringRecordList, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordList).inject(stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordList).inject(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordList).inject(stringRecordListMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordList).inject(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - dictionaries - reduce
|
||||
_.reduce(stringRecordDictionary, stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_.reduce(stringRecordDictionary, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordDictionary).reduce(stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordDictionary).reduce(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduce(stringRecordDictionaryMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduce(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - dictionaries - foldl
|
||||
_.foldl(stringRecordDictionary, stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_.foldl(stringRecordDictionary, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordDictionary).foldl(stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordDictionary).foldl(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldl(stringRecordDictionaryMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldl(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - dictionaries - inject
|
||||
_.inject(stringRecordDictionary, stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_.inject(stringRecordDictionary, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordDictionary).inject(stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordDictionary).inject(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordDictionary).inject(stringRecordDictionaryMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordDictionary).inject(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// object memo and memo-type result - strings - reduce
|
||||
_.reduce(simpleString, stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_.reduce(simpleString, stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
_(simpleString).reduce(stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_(simpleString).reduce(stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
extractChainTypes(_.chain(simpleString).reduce(stringListMemoIterator, dictionaryMemo)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
extractChainTypes(_.chain(simpleString).reduce(stringListMemoIterator, dictionaryMemo, context)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
|
||||
// object memo and memo-type result - strings - foldl
|
||||
_.foldl(simpleString, stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_.foldl(simpleString, stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
_(simpleString).foldl(stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_(simpleString).foldl(stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
extractChainTypes(_.chain(simpleString).foldl(stringListMemoIterator, dictionaryMemo)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
extractChainTypes(_.chain(simpleString).foldl(stringListMemoIterator, dictionaryMemo, context)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
|
||||
// object memo and memo-type result - strings - inject
|
||||
_.inject(simpleString, stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_.inject(simpleString, stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
_(simpleString).inject(stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_(simpleString).inject(stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
extractChainTypes(_.chain(simpleString).inject(stringListMemoIterator, dictionaryMemo)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
extractChainTypes(_.chain(simpleString).inject(stringListMemoIterator, dictionaryMemo, context)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
|
||||
// no memo and collection type result - strings - reduce
|
||||
_.reduce(simpleString, stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
_(simpleString).reduce(stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
extractChainTypes(_.chain(simpleString).reduce(stringListSelfMemoIterator)); // $ExpectType ChainType<string | undefined, string>
|
||||
|
||||
// no memo and collection type result - strings - foldl
|
||||
_.foldl(simpleString, stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
_(simpleString).foldl(stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
extractChainTypes(_.chain(simpleString).foldl(stringListSelfMemoIterator)); // $ExpectType ChainType<string | undefined, string>
|
||||
|
||||
// no memo and collection type result - strings - inject
|
||||
_.inject(simpleString, stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
_(simpleString).inject(stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
extractChainTypes(_.chain(simpleString).inject(stringListSelfMemoIterator)); // $ExpectType ChainType<string | undefined, string>
|
||||
|
||||
// constant primitive memo and type union result - lists - reduce
|
||||
_.reduce(stringRecordList, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordList).reduce(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordList).reduce(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - foldl
|
||||
_.foldl(stringRecordList, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordList).foldl(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordList).foldl(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - inject
|
||||
_.inject(stringRecordList, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordList).inject(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordList).inject(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - dictionaries - reduce
|
||||
_.reduce(stringRecordDictionary, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordDictionary).reduce(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduce(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - dictionaries - foldl
|
||||
_.foldl(stringRecordDictionary, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordDictionary).foldl(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldl(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - dictionaries - inject
|
||||
_.inject(stringRecordDictionary, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordDictionary).inject(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordDictionary).inject(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// no memo and union type result - strings - reduce
|
||||
_.reduce(simpleString, resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
_(simpleString).reduce(resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
extractChainTypes(_.chain(simpleString).reduce(resultUnionStringListMemoIterator)); // $ExpectType ChainType<string | number | undefined, string>
|
||||
|
||||
// no memo and union type result - strings - foldl
|
||||
_.foldl(simpleString, resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
_(simpleString).foldl(resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
extractChainTypes(_.chain(simpleString).foldl(resultUnionStringListMemoIterator)); // $ExpectType ChainType<string | number | undefined, string>
|
||||
|
||||
// no memo and union type result - strings - inject
|
||||
_.inject(simpleString, resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
_(simpleString).inject(resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
extractChainTypes(_.chain(simpleString).inject(resultUnionStringListMemoIterator)); // $ExpectType ChainType<string | number | undefined, string>
|
||||
}
|
||||
|
||||
// reduceRight, foldr
|
||||
{
|
||||
const stringMemo = '';
|
||||
const dictionaryMemo: _.Dictionary<number> = {};
|
||||
|
||||
// constant primitive memo and memo-type result - lists - reduceRight
|
||||
_.reduceRight(stringRecordList, stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_.reduceRight(stringRecordList, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordList).reduceRight(stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordList).reduceRight(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordList).reduceRight(stringRecordListMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordList).reduceRight(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - foldr
|
||||
_.foldr(stringRecordList, stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_.foldr(stringRecordList, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordList).foldr(stringRecordListMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordList).foldr(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordList).foldr(stringRecordListMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordList).foldr(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - dictionaries - reduceRight
|
||||
_.reduceRight(stringRecordDictionary, stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_.reduceRight(stringRecordDictionary, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordDictionary).reduceRight(stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordDictionary).reduceRight(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduceRight(stringRecordDictionaryMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduceRight(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// constant primitive memo and memo-type result - dictionaries - foldr
|
||||
_.foldr(stringRecordDictionary, stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_.foldr(stringRecordDictionary, stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
_(stringRecordDictionary).foldr(stringRecordDictionaryMemoIterator, stringMemo); // $ExpectType string
|
||||
_(stringRecordDictionary).foldr(stringRecordPartialMemoIterator, stringMemo, context); // $ExpectType string
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldr(stringRecordDictionaryMemoIterator, stringMemo)); // $ExpectType ChainType<string, string>
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldr(stringRecordPartialMemoIterator, stringMemo, context)); // $ExpectType ChainType<string, string>
|
||||
|
||||
// object memo and memo-type result - strings - reduceRight
|
||||
_.reduceRight(simpleString, stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_.reduceRight(simpleString, stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
_(simpleString).reduceRight(stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_(simpleString).reduceRight(stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
extractChainTypes(_.chain(simpleString).reduceRight(stringListMemoIterator, dictionaryMemo)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
extractChainTypes(_.chain(simpleString).reduceRight(stringListMemoIterator, dictionaryMemo, context)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
|
||||
// object memo and memo-type result - strings - foldr
|
||||
_.foldr(simpleString, stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_.foldr(simpleString, stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
_(simpleString).foldr(stringListMemoIterator, dictionaryMemo); // $ExpectType Dictionary<number>
|
||||
_(simpleString).foldr(stringListMemoIterator, dictionaryMemo, context); // $ExpectType Dictionary<number>
|
||||
extractChainTypes(_.chain(simpleString).foldr(stringListMemoIterator, dictionaryMemo)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
extractChainTypes(_.chain(simpleString).foldr(stringListMemoIterator, dictionaryMemo, context)); // $ExpectType ChainType<Dictionary<number>, number>
|
||||
|
||||
// no memo and collection type result - strings - reduceRight
|
||||
_.reduceRight(simpleString, stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
_(simpleString).reduceRight(stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
extractChainTypes(_.chain(simpleString).reduceRight(stringListSelfMemoIterator)); // $ExpectType ChainType<string | undefined, string>
|
||||
|
||||
// no memo and collection type result - strings - foldr
|
||||
_.foldr(simpleString, stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
_(simpleString).foldr(stringListSelfMemoIterator); // $ExpectType string | undefined
|
||||
extractChainTypes(_.chain(simpleString).foldr(stringListSelfMemoIterator)); // $ExpectType ChainType<string | undefined, string>
|
||||
|
||||
// constant primitive memo and type union result - lists - reduceRight
|
||||
_.reduceRight(stringRecordList, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordList).reduceRight(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordList).reduceRight(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - lists - foldr
|
||||
_.foldl(stringRecordList, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordList).foldl(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordList).foldl(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - dictionaries - reduceRight
|
||||
_.reduceRight(stringRecordDictionary, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordDictionary).reduceRight(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordDictionary).reduceRight(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// constant primitive memo and type union result - dictionaries - foldr
|
||||
_.foldr(stringRecordDictionary, resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
_(stringRecordDictionary).foldr(resultUnionPartialMemoIterator, stringMemo); // $ExpectType string | StringRecord
|
||||
extractChainTypes(_.chain(stringRecordDictionary).foldr(resultUnionPartialMemoIterator, stringMemo)); // $ExpectType ChainType<string | StringRecord, string>
|
||||
|
||||
// no memo and union type result - strings - reduceRight
|
||||
_.reduceRight(simpleString, resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
_(simpleString).reduceRight(resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
extractChainTypes(_.chain(simpleString).reduceRight(resultUnionStringListMemoIterator)); // $ExpectType ChainType<string | number | undefined, string>
|
||||
|
||||
// no memo and union type result - strings - foldr
|
||||
_.foldr(simpleString, resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
_(simpleString).foldr(resultUnionStringListMemoIterator); // $ExpectType string | number | undefined
|
||||
extractChainTypes(_.chain(simpleString).foldr(resultUnionStringListMemoIterator)); // $ExpectType ChainType<string | number | undefined, string>
|
||||
}
|
||||
|
||||
// filter, select
|
||||
{
|
||||
// function iteratee - lists
|
||||
// function iteratee - lists - filter
|
||||
_.filter(stringRecordList, stringRecordListBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).filter(stringRecordListBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).filter(stringRecordListBooleanIterator, context)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// function iteratee - lists - select
|
||||
_.select(stringRecordList, stringRecordListBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).select(stringRecordListBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).select(stringRecordListBooleanIterator, context)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// function iteratee - dictionaries
|
||||
// function iteratee - dictionaries - filter
|
||||
_.filter(stringRecordDictionary, stringRecordDictionaryBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).filter(stringRecordDictionaryBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).filter(stringRecordDictionaryBooleanIterator, context)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// function iteratee - dictionaries - select
|
||||
_.select(stringRecordDictionary, stringRecordDictionaryBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).select(stringRecordDictionaryBooleanIterator, context); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).select(stringRecordDictionaryBooleanIterator, context)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// function iteratee - strings
|
||||
// function iteratee - strings - filter
|
||||
_.filter(simpleString, stringListBooleanIterator, context); // $ExpectType string[]
|
||||
_(simpleString).filter(stringListBooleanIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(simpleString).filter(stringListBooleanIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// function iteratee - strings - select
|
||||
_.select(simpleString, stringListBooleanIterator, context); // $ExpectType string[]
|
||||
_(simpleString).select(stringListBooleanIterator, context); // $ExpectType string[]
|
||||
extractChainTypes(_.chain(simpleString).select(stringListBooleanIterator, context)); // $ExpectType ChainType<string[], string>
|
||||
|
||||
// partial object iteratee - lists
|
||||
// partial object iteratee - lists - filter
|
||||
_.filter(stringRecordList, partialStringRecord); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).filter(partialStringRecord); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).filter(partialStringRecord)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// partial object iteratee - lists - select
|
||||
_.select(stringRecordList, partialStringRecord); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).select(partialStringRecord); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).select(partialStringRecord)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// partial object iteratee - dictionaries
|
||||
// partial object iteratee - dictionaries - filter
|
||||
_.filter(stringRecordDictionary, partialStringRecord); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).filter(partialStringRecord); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).filter(partialStringRecord)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// partial object iteratee - dictionaries - select
|
||||
_.select(stringRecordDictionary, partialStringRecord); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).select(partialStringRecord); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).select(partialStringRecord)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property name iteratee - lists
|
||||
// property name iteratee - lists - filter
|
||||
_.filter(stringRecordList, stringRecordProperty); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).filter(stringRecordProperty); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).filter(stringRecordProperty)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property name iteratee - lists - select
|
||||
_.select(stringRecordList, stringRecordProperty); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).select(stringRecordProperty); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).select(stringRecordProperty)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property name iteratee - dictionaries
|
||||
// property name iteratee - dictionaries - filter
|
||||
_.filter(stringRecordDictionary, stringRecordProperty); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).filter(stringRecordProperty); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).filter(stringRecordProperty)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property name iteratee - dictionaries - select
|
||||
_.select(stringRecordDictionary, stringRecordProperty); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).select(stringRecordProperty); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).select(stringRecordProperty)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property path iteratee - lists
|
||||
// property path iteratee - lists - filter
|
||||
_.filter(stringRecordList, stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).filter(stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).filter(stringRecordPropertyPath)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property path iteratee - lists - select
|
||||
_.select(stringRecordList, stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
_(stringRecordList).select(stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordList).select(stringRecordPropertyPath)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property path iteratee - dictionaries
|
||||
// property path iteratee - dictionaries - filter
|
||||
_.filter(stringRecordDictionary, stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).filter(stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).filter(stringRecordPropertyPath)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
// property path iteratee - dictionaries - select
|
||||
_.select(stringRecordDictionary, stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
_(stringRecordDictionary).select(stringRecordPropertyPath); // $ExpectType StringRecord[]
|
||||
extractChainTypes(_.chain(stringRecordDictionary).select(stringRecordPropertyPath)); // $ExpectType ChainType<StringRecord[], StringRecord>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user