mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: added _.value aliases (_.run, _.toJSON)
This commit is contained in:
@@ -135,15 +135,11 @@ result = <string>_('test').toString();
|
||||
result = <string>_([1, 2, 3]).toString();
|
||||
result = <string>_({ 'key1': 'test1', 'key2': 'test2' }).toString();
|
||||
|
||||
result = <string>_('test').valueOf();
|
||||
result = <number[]>_([1, 2, 3]).valueOf();
|
||||
result = <_.Dictionary<string>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).valueOf();
|
||||
|
||||
// _.value (aliases: _.run, _.toJSON, _.valueOf)
|
||||
result = <string>_('test').value();
|
||||
result = <number[]>_([1, 2, 3]).value();
|
||||
result = <_.Dictionary<string>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).value();
|
||||
|
||||
result = <_.Dictionary<number>>_({ a: 1, b: 2}).mapValues(function(num: number) { return num * 2; }).value();
|
||||
result = <number[]>_([1, 2, 3]).run();
|
||||
result = <_.Dictionary<string>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).toJSON();
|
||||
result = <_.Dictionary<number>>_({ a: 1, b: 2}).mapValues(function(num: number) { return num * 2; }).valueOf();
|
||||
|
||||
// /*************
|
||||
// * Arrays *
|
||||
|
||||
Vendored
+17
-7
@@ -177,15 +177,25 @@ declare module _ {
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
* Extracts the wrapped value.
|
||||
* @return The wrapped value.
|
||||
**/
|
||||
valueOf(): T;
|
||||
|
||||
/**
|
||||
* @see valueOf
|
||||
* Executes the chained sequence to extract the unwrapped value.
|
||||
* @return Returns the resolved unwrapped value.
|
||||
**/
|
||||
value(): T;
|
||||
|
||||
/**
|
||||
* @see _.value
|
||||
**/
|
||||
run(): T;
|
||||
|
||||
/**
|
||||
* @see _.value
|
||||
**/
|
||||
toJSON(): T;
|
||||
|
||||
/**
|
||||
* @see _.value
|
||||
**/
|
||||
valueOf(): T;
|
||||
}
|
||||
|
||||
interface LoDashWrapper<T> extends LoDashWrapperBase<T, LoDashWrapper<T>> { }
|
||||
|
||||
Reference in New Issue
Block a user