mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-14 05:50:20 +00:00
lodash: changed _.identity() method
This commit is contained in:
+16
-2
@@ -1644,8 +1644,6 @@ var testAttempFn: TestAttemptFn;
|
||||
result = <TResult|Error>_.attempt<TResult>(testAttempFn);
|
||||
result = <TResult|Error>_(testAttempFn).attempt<TResult>();
|
||||
|
||||
result = <{ name: string }>_.identity({ 'name': 'moe' });
|
||||
|
||||
_.mixin({
|
||||
'capitalize': function (string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
@@ -1895,6 +1893,22 @@ result = <() => boolean>_(true).constant<boolean>();
|
||||
result = <() => any[]>_(['a']).constant<any[]>();
|
||||
result = <() => {}>_({}).constant<{}>();
|
||||
|
||||
// _.identity
|
||||
{
|
||||
let testIdentityValue: TResult;
|
||||
let result: TResult;
|
||||
result = _.identity<TResult>(testIdentityValue);
|
||||
result = _(testIdentityValue).identity();
|
||||
}
|
||||
{
|
||||
let result: number;
|
||||
result = _(42).identity();
|
||||
}
|
||||
{
|
||||
let result: boolean[];
|
||||
result = _<boolean>([]).identity();
|
||||
}
|
||||
|
||||
// _.method
|
||||
class TestMethod {
|
||||
a = {
|
||||
|
||||
Vendored
+25
-4
@@ -7993,13 +7993,34 @@ declare module _ {
|
||||
//_.identity
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* This method returns the first argument provided to it.
|
||||
* @param value Any value.
|
||||
* @return value.
|
||||
**/
|
||||
* This method returns the first argument provided to it.
|
||||
* @param value Any value.
|
||||
* @return Returns value.
|
||||
*/
|
||||
identity<T>(value?: T): T;
|
||||
}
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.identity
|
||||
*/
|
||||
identity(): T;
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.identity
|
||||
*/
|
||||
identity(): T[];
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.identity
|
||||
*/
|
||||
identity(): T;
|
||||
}
|
||||
|
||||
//_.method
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user