mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 22:36:10 +08:00
lodash: changed _.isString() method
This commit is contained in:
@@ -1242,6 +1242,12 @@ result = <boolean>_(1).isRegExp();
|
||||
result = <boolean>_<any>([]).isRegExp();
|
||||
result = <boolean>_({}).isRegExp();
|
||||
|
||||
// _.isString
|
||||
result = <boolean>_.isString(any);
|
||||
result = <boolean>_(1).isString();
|
||||
result = <boolean>_<any>([]).isString();
|
||||
result = <boolean>_({}).isString();
|
||||
|
||||
// _.isTypedArray
|
||||
result = <boolean>_.isTypedArray([]);
|
||||
result = <boolean>_([]).isTypedArray();
|
||||
@@ -1492,8 +1498,6 @@ result = <boolean>_.isPlainObject(new Stooge('moe', 40));
|
||||
result = <boolean>_.isPlainObject([1, 2, 3]);
|
||||
result = <boolean>_.isPlainObject({ 'name': 'moe', 'age': 40 });
|
||||
|
||||
result = <boolean>_.isString('moe');
|
||||
|
||||
result = <string[]>_.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
result = <string[]>_({ 'one': 1, 'two': 2, 'three': 3 }).keys().value();
|
||||
|
||||
|
||||
27
lodash/lodash.d.ts
vendored
27
lodash/lodash.d.ts
vendored
@@ -6294,6 +6294,23 @@ declare module _ {
|
||||
isRegExp(): boolean;
|
||||
}
|
||||
|
||||
//_.isString
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is classified as a String primitive or object.
|
||||
* @param value The value to check.
|
||||
* @return Returns true if value is correctly classified, else false.
|
||||
**/
|
||||
isString(value?: any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isString
|
||||
*/
|
||||
isString(): boolean;
|
||||
}
|
||||
|
||||
//_.isTypedArray
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -7143,16 +7160,6 @@ declare module _ {
|
||||
isPlainObject(value?: any): boolean;
|
||||
}
|
||||
|
||||
//_.isString
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is a string.
|
||||
* @param value The value to check.
|
||||
* @return True if the value is a string, else false.
|
||||
**/
|
||||
isString(value?: any): boolean;
|
||||
}
|
||||
|
||||
//_.keys
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user