lodash: changed _.isString() method

This commit is contained in:
Ilya Mochalov
2015-08-22 14:47:40 +05:00
parent af81415504
commit 3bb6702394
2 changed files with 23 additions and 12 deletions

View File

@@ -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
View File

@@ -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 {
/**