File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- export function isString ( value : any ) : boolean {
1+ export function isString ( value : any ) : value is string {
22 return typeof value === 'string' || value instanceof String ;
33}
44
5- export function isNumber ( value : any ) : boolean {
5+ export function isNumber ( value : any ) : value is number {
66 return typeof value === 'number' || value instanceof Number ;
77}
88
9- export function isBoolean ( value : any ) : boolean {
9+ export function isBoolean ( value : any ) : value is boolean {
1010 return typeof value === 'boolean' || value instanceof Boolean ;
1111}
1212
13- export function isFunction ( value : any ) : boolean {
13+ export function isFunction ( value : any ) : value is Function {
1414 if ( ! value ) {
1515 return false ;
1616 }
1717
1818 return typeof value === 'function' ;
1919}
2020
21- export function isObject ( value : any ) : boolean {
21+ export function isObject ( value : any ) : value is Record < string , any > {
2222 if ( ! value ) {
2323 return false ;
2424 }
2525
2626 return typeof value === 'object' ;
2727}
2828
29- export function isUndefined ( value : any ) : boolean {
29+ export function isUndefined ( value : any ) : value is undefined {
3030 return typeof value === 'undefined' ;
3131}
3232
You can’t perform that action at this time.
0 commit comments