isString true for String object (#245)
* Fix isString * value is * Fix isHex too * Fix isHex * Add hex test with String
This commit is contained in:
committed by
Jaco Greeff
parent
6c85979c3a
commit
7a43354ece
@@ -17,6 +17,6 @@
|
||||
* console.log('isString', isString('test')); // => true
|
||||
* ```
|
||||
*/
|
||||
export default function isString (value: any): value is string {
|
||||
return typeof value === 'string';
|
||||
export default function isString (value: any): value is string | String {
|
||||
return typeof value === 'string' || value instanceof String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user