1
- /*! Raven.js 3.21 .0 (fbfea0f ) | github.com/getsentry/raven-js */
1
+ /*! Raven.js 3.22 .0 (50583ff ) | github.com/getsentry/raven-js */
2
2
3
3
/*
4
4
* Includes TraceKit
5
5
* https://github.com/getsentry/TraceKit
6
6
*
7
- * Copyright 2017 Matt Robenolt and other contributors
7
+ * Copyright 2018 Matt Robenolt and other contributors
8
8
* Released under the BSD license
9
9
* https://github.com/getsentry/raven-js/blob/master/LICENSE
10
10
*
@@ -124,6 +124,10 @@ function isFunction(what) {
124
124
return typeof what === 'function' ;
125
125
}
126
126
127
+ function isPlainObject ( what ) {
128
+ return Object . prototype . toString . call ( what ) === '[object Object]' ;
129
+ }
130
+
127
131
function isString ( what ) {
128
132
return Object . prototype . toString . call ( what ) === '[object String]' ;
129
133
}
@@ -133,6 +137,8 @@ function isArray(what) {
133
137
}
134
138
135
139
function isEmptyObject ( what ) {
140
+ if ( ! isPlainObject ( what ) ) return false ;
141
+
136
142
for ( var _ in what ) {
137
143
if ( what . hasOwnProperty ( _ ) ) {
138
144
return false ;
@@ -269,8 +275,8 @@ function urlencode(o) {
269
275
// intentionally using regex and not <a/> href parsing trick because React Native and other
270
276
// environments where DOM might not be available
271
277
function parseUrl ( url ) {
278
+ if ( typeof url !== 'string' ) return { } ;
272
279
var match = url . match ( / ^ ( ( [ ^ : \/ ? # ] + ) : ) ? ( \/ \/ ( [ ^ \/ ? # ] * ) ) ? ( [ ^ ? # ] * ) ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ) ;
273
- if ( ! match ) return { } ;
274
280
275
281
// coerce to undefined values to empty string so we don't get 'undefined'
276
282
var query = match [ 6 ] || '' ;
@@ -487,6 +493,7 @@ module.exports = {
487
493
isErrorEvent : isErrorEvent ,
488
494
isUndefined : isUndefined ,
489
495
isFunction : isFunction ,
496
+ isPlainObject : isPlainObject ,
490
497
isString : isString ,
491
498
isArray : isArray ,
492
499
isEmptyObject : isEmptyObject ,
0 commit comments