Merge pull request #5493 from chrootsu/lodash-isString

lodash: changed _.isString() method
This commit is contained in:
Masahiro Wakame
2015-08-26 00:57:31 +09:00
2 changed files with 23 additions and 12 deletions

View File

@@ -1254,6 +1254,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();
@@ -1500,8 +1506,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
View File

@@ -6329,6 +6329,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 {
/**
@@ -7156,16 +7173,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 {
/**