Skip to content

Commit 64cda8c

Browse files
authored
Merge branch 'master' into abhi-ensure-before-sendrv
2 parents 8376cf0 + 0f49c02 commit 64cda8c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/utils/src/is.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Primitive } from '@sentry/types';
99
* @param wat A value to be checked.
1010
* @returns A boolean representing the result.
1111
*/
12-
export function isError(wat: any): boolean {
12+
export function isError(wat: unknown): boolean {
1313
switch (Object.prototype.toString.call(wat)) {
1414
case '[object Error]':
1515
return true;
@@ -29,7 +29,7 @@ export function isError(wat: any): boolean {
2929
* @param wat A value to be checked.
3030
* @returns A boolean representing the result.
3131
*/
32-
export function isErrorEvent(wat: any): boolean {
32+
export function isErrorEvent(wat: unknown): boolean {
3333
return Object.prototype.toString.call(wat) === '[object ErrorEvent]';
3434
}
3535

@@ -40,7 +40,7 @@ export function isErrorEvent(wat: any): boolean {
4040
* @param wat A value to be checked.
4141
* @returns A boolean representing the result.
4242
*/
43-
export function isDOMError(wat: any): boolean {
43+
export function isDOMError(wat: unknown): boolean {
4444
return Object.prototype.toString.call(wat) === '[object DOMError]';
4545
}
4646

@@ -51,7 +51,7 @@ export function isDOMError(wat: any): boolean {
5151
* @param wat A value to be checked.
5252
* @returns A boolean representing the result.
5353
*/
54-
export function isDOMException(wat: any): boolean {
54+
export function isDOMException(wat: unknown): boolean {
5555
return Object.prototype.toString.call(wat) === '[object DOMException]';
5656
}
5757

@@ -62,7 +62,7 @@ export function isDOMException(wat: any): boolean {
6262
* @param wat A value to be checked.
6363
* @returns A boolean representing the result.
6464
*/
65-
export function isString(wat: any): boolean {
65+
export function isString(wat: unknown): boolean {
6666
return Object.prototype.toString.call(wat) === '[object String]';
6767
}
6868

@@ -73,7 +73,7 @@ export function isString(wat: any): boolean {
7373
* @param wat A value to be checked.
7474
* @returns A boolean representing the result.
7575
*/
76-
export function isPrimitive(wat: any): wat is Primitive {
76+
export function isPrimitive(wat: unknown): wat is Primitive {
7777
return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
7878
}
7979

@@ -84,7 +84,7 @@ export function isPrimitive(wat: any): wat is Primitive {
8484
* @param wat A value to be checked.
8585
* @returns A boolean representing the result.
8686
*/
87-
export function isPlainObject(wat: any): boolean {
87+
export function isPlainObject(wat: unknown): wat is Record<string, unknown> {
8888
return Object.prototype.toString.call(wat) === '[object Object]';
8989
}
9090

@@ -95,7 +95,7 @@ export function isPlainObject(wat: any): boolean {
9595
* @param wat A value to be checked.
9696
* @returns A boolean representing the result.
9797
*/
98-
export function isEvent(wat: any): boolean {
98+
export function isEvent(wat: unknown): wat is Event {
9999
return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
100100
}
101101

@@ -106,7 +106,7 @@ export function isEvent(wat: any): boolean {
106106
* @param wat A value to be checked.
107107
* @returns A boolean representing the result.
108108
*/
109-
export function isElement(wat: any): boolean {
109+
export function isElement(wat: unknown): wat is Element {
110110
return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
111111
}
112112

@@ -117,15 +117,15 @@ export function isElement(wat: any): boolean {
117117
* @param wat A value to be checked.
118118
* @returns A boolean representing the result.
119119
*/
120-
export function isRegExp(wat: any): boolean {
120+
export function isRegExp(wat: unknown): wat is RegExp {
121121
return Object.prototype.toString.call(wat) === '[object RegExp]';
122122
}
123123

124124
/**
125125
* Checks whether given value has a then function.
126126
* @param wat A value to be checked.
127127
*/
128-
export function isThenable(wat: any): boolean {
128+
export function isThenable(wat: any): wat is PromiseLike<any> {
129129
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
130130
return Boolean(wat && wat.then && typeof wat.then === 'function');
131131
}
@@ -137,7 +137,7 @@ export function isThenable(wat: any): boolean {
137137
* @param wat A value to be checked.
138138
* @returns A boolean representing the result.
139139
*/
140-
export function isSyntheticEvent(wat: any): boolean {
140+
export function isSyntheticEvent(wat: unknown): boolean {
141141
return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
142142
}
143143
/**

packages/utils/src/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function getWalkSource(
103103
currentTarget?: unknown;
104104
}
105105

106-
const event = value as SimpleEvent;
106+
const event = (value as unknown) as SimpleEvent;
107107

108108
const source: {
109109
[key: string]: any;

0 commit comments

Comments
 (0)