mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
(feature) Renamed _.sortByOrder to _.orderBy
This commit is contained in:
+48
-48
@@ -5291,8 +5291,8 @@ module TestSortByAll {
|
||||
}
|
||||
}
|
||||
|
||||
// _.sortByOrder
|
||||
module TestSortByOrder {
|
||||
// _.orderBy
|
||||
module TestorderBy {
|
||||
type SampleObject = {a: number; b: string; c: boolean};
|
||||
|
||||
let array: SampleObject[];
|
||||
@@ -5305,79 +5305,79 @@ module TestSortByOrder {
|
||||
let iteratees: (value: string) => any|((value: string) => any)[];
|
||||
let result: string[];
|
||||
|
||||
result = _.sortByOrder<string>('acbd', iteratees);
|
||||
result = _.sortByOrder<string>('acbd', iteratees, orders);
|
||||
result = _.orderBy<string>('acbd', iteratees);
|
||||
result = _.orderBy<string>('acbd', iteratees, orders);
|
||||
}
|
||||
|
||||
{
|
||||
let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[];
|
||||
let result: SampleObject[];
|
||||
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(array, iteratees);
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(array, iteratees, orders);
|
||||
result = _.sortByOrder<SampleObject>(array, iteratees);
|
||||
result = _.sortByOrder<SampleObject>(array, iteratees, orders);
|
||||
result = _.orderBy<{a: number}, SampleObject>(array, iteratees);
|
||||
result = _.orderBy<{a: number}, SampleObject>(array, iteratees, orders);
|
||||
result = _.orderBy<SampleObject>(array, iteratees);
|
||||
result = _.orderBy<SampleObject>(array, iteratees, orders);
|
||||
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(list, iteratees);
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(list, iteratees, orders);
|
||||
result = _.sortByOrder<SampleObject>(list, iteratees);
|
||||
result = _.sortByOrder<SampleObject>(list, iteratees, orders);
|
||||
result = _.orderBy<{a: number}, SampleObject>(list, iteratees);
|
||||
result = _.orderBy<{a: number}, SampleObject>(list, iteratees, orders);
|
||||
result = _.orderBy<SampleObject>(list, iteratees);
|
||||
result = _.orderBy<SampleObject>(list, iteratees, orders);
|
||||
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(numericDictionary, iteratees);
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(numericDictionary, iteratees, orders);
|
||||
result = _.sortByOrder<SampleObject>(numericDictionary, iteratees);
|
||||
result = _.sortByOrder<SampleObject>(numericDictionary, iteratees, orders);
|
||||
result = _.orderBy<{a: number}, SampleObject>(numericDictionary, iteratees);
|
||||
result = _.orderBy<{a: number}, SampleObject>(numericDictionary, iteratees, orders);
|
||||
result = _.orderBy<SampleObject>(numericDictionary, iteratees);
|
||||
result = _.orderBy<SampleObject>(numericDictionary, iteratees, orders);
|
||||
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(dictionary, iteratees);
|
||||
result = _.sortByOrder<{a: number}, SampleObject>(dictionary, iteratees, orders);
|
||||
result = _.sortByOrder<SampleObject>(dictionary, iteratees);
|
||||
result = _.sortByOrder<SampleObject>(dictionary, iteratees, orders);
|
||||
result = _.orderBy<{a: number}, SampleObject>(dictionary, iteratees);
|
||||
result = _.orderBy<{a: number}, SampleObject>(dictionary, iteratees, orders);
|
||||
result = _.orderBy<SampleObject>(dictionary, iteratees);
|
||||
result = _.orderBy<SampleObject>(dictionary, iteratees, orders);
|
||||
}
|
||||
|
||||
{
|
||||
let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[];
|
||||
let result: _.LoDashImplicitArrayWrapper<SampleObject>;
|
||||
|
||||
result = _(array).sortByOrder<{a: number}>(iteratees);
|
||||
result = _(array).sortByOrder<{a: number}>(iteratees, orders);
|
||||
result = _(array).orderBy<{a: number}>(iteratees);
|
||||
result = _(array).orderBy<{a: number}>(iteratees, orders);
|
||||
|
||||
result = _(list).sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(list).sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(list).sortByOrder<SampleObject>(iteratees);
|
||||
result = _(list).sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(list).orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(list).orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(list).orderBy<SampleObject>(iteratees);
|
||||
result = _(list).orderBy<SampleObject>(iteratees, orders);
|
||||
|
||||
result = _(numericDictionary).sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(numericDictionary).sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).sortByOrder<SampleObject>(iteratees);
|
||||
result = _(numericDictionary).sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(numericDictionary).orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).orderBy<SampleObject>(iteratees);
|
||||
result = _(numericDictionary).orderBy<SampleObject>(iteratees, orders);
|
||||
|
||||
result = _(dictionary).sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(dictionary).sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).sortByOrder<SampleObject>(iteratees);
|
||||
result = _(dictionary).sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(dictionary).orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).orderBy<SampleObject>(iteratees);
|
||||
result = _(dictionary).orderBy<SampleObject>(iteratees, orders);
|
||||
}
|
||||
|
||||
{
|
||||
let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[];
|
||||
let result: _.LoDashExplicitArrayWrapper<SampleObject>;
|
||||
|
||||
result = _(array).chain().sortByOrder<{a: number}>(iteratees);
|
||||
result = _(array).chain().sortByOrder<{a: number}>(iteratees, orders);
|
||||
result = _(array).chain().orderBy<{a: number}>(iteratees);
|
||||
result = _(array).chain().orderBy<{a: number}>(iteratees, orders);
|
||||
|
||||
result = _(list).chain().sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(list).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(list).chain().sortByOrder<SampleObject>(iteratees);
|
||||
result = _(list).chain().sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(list).chain().orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(list).chain().orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(list).chain().orderBy<SampleObject>(iteratees);
|
||||
result = _(list).chain().orderBy<SampleObject>(iteratees, orders);
|
||||
|
||||
result = _(numericDictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(numericDictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).chain().sortByOrder<SampleObject>(iteratees);
|
||||
result = _(numericDictionary).chain().sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).chain().orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(numericDictionary).chain().orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(numericDictionary).chain().orderBy<SampleObject>(iteratees);
|
||||
result = _(numericDictionary).chain().orderBy<SampleObject>(iteratees, orders);
|
||||
|
||||
result = _(dictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees);
|
||||
result = _(dictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).chain().sortByOrder<SampleObject>(iteratees);
|
||||
result = _(dictionary).chain().sortByOrder<SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).chain().orderBy<{a: number}, SampleObject>(iteratees);
|
||||
result = _(dictionary).chain().orderBy<{a: number}, SampleObject>(iteratees, orders);
|
||||
result = _(dictionary).chain().orderBy<SampleObject>(iteratees);
|
||||
result = _(dictionary).chain().orderBy<SampleObject>(iteratees, orders);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+45
-45
@@ -24,7 +24,7 @@ TODO:
|
||||
- [x] Renamed _.pairs to _.toPairs
|
||||
- [x] Renamed _.rest to _.tail
|
||||
- [x] Renamed _.restParam to _.rest
|
||||
- [ ] Renamed _.sortByOrder to _.orderBy
|
||||
- [x] Renamed _.sortByOrder to _.orderBy
|
||||
- [ ] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd
|
||||
- [ ] Renamed _.trunc to _.truncate
|
||||
|
||||
@@ -8671,7 +8671,7 @@ declare module _ {
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.sortByOrder
|
||||
//_.orderBy
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* This method is like _.sortByAll except that it allows specifying the sort orders of the iteratees to sort
|
||||
@@ -8689,52 +8689,52 @@ declare module _ {
|
||||
* @param orders The sort orders of iteratees.
|
||||
* @return Returns the new sorted array.
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
collection: List<T>,
|
||||
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
collection: List<T>,
|
||||
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
collection: NumericDictionary<T>,
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
collection: NumericDictionary<T>,
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
collection: Dictionary<T>,
|
||||
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
collection: Dictionary<T>,
|
||||
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
@@ -8743,9 +8743,9 @@ declare module _ {
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder(
|
||||
orderBy(
|
||||
iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
@@ -8753,9 +8753,9 @@ declare module _ {
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object>(
|
||||
orderBy<W extends Object>(
|
||||
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
@@ -8763,49 +8763,49 @@ declare module _ {
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
@@ -8813,9 +8813,9 @@ declare module _ {
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder(
|
||||
orderBy(
|
||||
iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
@@ -8823,9 +8823,9 @@ declare module _ {
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object>(
|
||||
orderBy<W extends Object>(
|
||||
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
@@ -8833,49 +8833,49 @@ declare module _ {
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<W extends Object, T>(
|
||||
orderBy<W extends Object, T>(
|
||||
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortByOrder
|
||||
* @see _.orderBy
|
||||
*/
|
||||
sortByOrder<T>(
|
||||
orderBy<T>(
|
||||
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
||||
orders?: boolean|string|(boolean|string)[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
Reference in New Issue
Block a user