File tree Expand file tree Collapse file tree 3 files changed +3
-26
lines changed Expand file tree Collapse file tree 3 files changed +3
-26
lines changed Original file line number Diff line number Diff line change 1
1
import { DsnComponents , DsnLike , DsnProtocol } from '@sentry/types' ;
2
2
import { SentryError } from '@sentry/utils/error' ;
3
- import { isNaN } from '@sentry/utils/is' ;
4
3
5
4
/** Regular expression used to parse a Dsn. */
6
5
const DSN_REGEX = / ^ (?: ( \w + ) : ) \/ \/ (?: ( \w + ) (?: : ( \w + ) ) ? @ ) ( [ \w \. - ] + ) (?: : ( \d + ) ) ? \/ ( .+ ) / ;
@@ -92,7 +91,7 @@ export class Dsn implements DsnComponents {
92
91
throw new SentryError ( `Invalid Dsn: Unsupported protocol "${ this . protocol } "` ) ;
93
92
}
94
93
95
- if ( this . port && isNaN ( parseInt ( this . port , 10 ) ) ) {
94
+ if ( this . port && Number . isNaN ( parseInt ( this . port , 10 ) ) ) {
96
95
throw new SentryError ( `Invalid Dsn: Invalid port number "${ this . port } "` ) ;
97
96
}
98
97
}
Original file line number Diff line number Diff line change @@ -95,17 +95,6 @@ export function isPrimitive(wat: any): boolean {
95
95
return wat === null || ( typeof wat !== 'object' && typeof wat !== 'function' ) ;
96
96
}
97
97
98
- /**
99
- * Checks whether given value's type is an array
100
- * {@link isArray}.
101
- *
102
- * @param wat A value to be checked.
103
- * @returns A boolean representing the result.
104
- */
105
- export function isArray ( wat : any ) : boolean {
106
- return Object . prototype . toString . call ( wat ) === '[object Array]' ;
107
- }
108
-
109
98
/**
110
99
* Checks whether given value's type is an object literal
111
100
* {@link isPlainObject}.
@@ -128,17 +117,6 @@ export function isRegExp(wat: any): boolean {
128
117
return Object . prototype . toString . call ( wat ) === '[object RegExp]' ;
129
118
}
130
119
131
- /**
132
- * Checks whether given value's type is a NaN
133
- * {@link isNaN}.
134
- *
135
- * @param wat A value to be checked.
136
- * @returns A boolean representing the result.
137
- */
138
- export function isNaN ( wat : any ) : boolean {
139
- return wat !== wat ;
140
- }
141
-
142
120
/**
143
121
* Checks whether given value has a then function.
144
122
* @param wat A value to be checked.
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ export function serializeObject<T>(value: T, depth: number): T | string | {} {
146
146
} ) ;
147
147
148
148
return serialized ;
149
- } else if ( isArray ( value ) ) {
149
+ } else if ( Array . isArray ( value ) ) {
150
150
const val = ( value as any ) as T [ ] ;
151
151
return val . map ( v => serializeObject ( v , depth - 1 ) ) ;
152
152
}
@@ -267,7 +267,7 @@ function normalizeValue(value: any, key?: any): any {
267
267
return Object . getPrototypeOf ( value ) ? value . constructor . name : 'Event' ;
268
268
}
269
269
270
- if ( isNaN ( value ) ) {
270
+ if ( Number . isNaN ( value as number ) ) {
271
271
return '[NaN]' ;
272
272
}
273
273
You can’t perform that action at this time.
0 commit comments