8000 fix(core): improved types for common utils (#10628) · NativeScript/NativeScript@17a94a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 17a94a2

Browse files
authored
fix(core): improved types for common utils (#10628)
1 parent 34c692f commit 17a94a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/core/utils/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
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

0 commit comments

Comments
 (0)
0