Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Merge PR #46120 [@types/underscore] Collection and Array Tests - Ea…
…ch, ToArray, and Partition by @reubenrybnik * Updating type definitions for each, partition, and toArray and adding tests. * Adding a multi-call chain test. * Fixing some issues around type unions and implicit any errors for each by redefining CollectionIterator to only use conditional types to determine the potential key type for the iterator. * Adding tests around issues fixed by the change to CollectionIterator and updating the base each tests to be a more interesting and abbreviated. * Adding identity iteratee tests for partition and making the identity iteratee tests for find, filter, and reject more realistic by using potentially falsy types. * Removing IterateePropertyShorthand because the last thing that was using it got updated at some point and I forgot to remove it at that time. * Update summary comments to reflect that the iteratee for `each` is always a function. * Moving EnumerableKey and CollectionKey up above the iterators. * Updating CollectionIterator and MemoCollectionIterator to be interfaces instead of types and updating MemoCollectionIterator to use the same pattern as CollectionIterator. * Updating Array<EnumerableKey> to EnumerableKey[] to match other array usages elsewhere in these definitions. * Adding tests for the more complicated Iteratee and IterateeResult types. * Dropping extra overloads of reduce and reduceRight since getting rid of the extends checks in MemoCollectionIterator seems to have gotten rid of the result narrowing issue that was previously preventing that from working. * Dropping MemoIterator and MemoObjectIterator since they're no longer referenced. * While I'm cleaning up reduce and reduceRight anyway, also updating the Underscore and _Chain versions of them to use T instead of TypeOfCollection<V> more often. * Revert "Dropping MemoIterator and MemoObjectIterator since they're no longer referenced." This reverts commit 53d6759. * Updating non-collection iterator types to be aliases of collection iterator types. * Putting better constraints on iterators and temporarily reverting back to not using T in a few places to compensate. * Adding missing $ExpectTypes in function Iteratee tests. * Adding null to Iteratee and IterateeResult and moving undefined to the end of those types. * Adding null iteratee tests.
- Loading branch information