mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-27 11:40:08 +08:00
Merge pull request #8597 from chrootsu/lodash-last
lodash: changed _.last
This commit is contained in:
@@ -950,6 +950,13 @@ namespace TestLast {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
|
||||
{
|
||||
let result: string;
|
||||
|
||||
result = _.last('abc');
|
||||
result = _('abc').last();
|
||||
}
|
||||
|
||||
{
|
||||
let result: TResult;
|
||||
|
||||
@@ -961,15 +968,21 @@ namespace TestLast {
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _(array).chain().last();
|
||||
result = _('abc').chain().last();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<_.List<TResult>>;
|
||||
let result: _.LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
result = _(list).chain().last<_.List<TResult>>();
|
||||
result = _(array).chain().last<_.LoDashExplicitObjectWrapper<TResult>>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
result = _(list).chain().last<_.LoDashExplicitObjectWrapper<TResult>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+16
-2
@@ -1472,6 +1472,13 @@ declare module _ {
|
||||
last<T>(array: List<T>): T;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): string;
|
||||
}
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
@@ -1486,18 +1493,25 @@ declare module _ {
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): LoDashExplicitArrayWrapper<T>;
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last<T>(): LoDashExplicitObjectWrapper<T>;
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
//_.lastIndexOf
|
||||
|
||||
+17
-4
@@ -1167,6 +1167,13 @@ namespace TestLast {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
|
||||
{
|
||||
let result: string;
|
||||
|
||||
result = _.last('abc');
|
||||
result = _('abc').last();
|
||||
}
|
||||
|
||||
{
|
||||
let result: TResult;
|
||||
|
||||
@@ -1178,15 +1185,21 @@ namespace TestLast {
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _(array).chain().last();
|
||||
result = _('abc').chain().last();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<_.List<TResult>>;
|
||||
let result: _.LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
result = _(list).chain().last<_.List<TResult>>();
|
||||
result = _(array).chain().last<_.LoDashExplicitObjectWrapper<TResult>>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<TResult>;
|
||||
|
||||
result = _(list).chain().last<_.LoDashExplicitObjectWrapper<TResult>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+16
-2
@@ -2506,6 +2506,13 @@ declare module _ {
|
||||
last<T>(array: List<T>): T;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): string;
|
||||
}
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
@@ -2520,18 +2527,25 @@ declare module _ {
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(): LoDashExplicitArrayWrapper<T>;
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last<T>(): LoDashExplicitObjectWrapper<T>;
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
//_.lastIndexOf
|
||||
|
||||
Reference in New Issue
Block a user