@@ -32,33 +32,35 @@ export let rewriteFrameIntegration: {
32
32
*/
33
33
export function getDefaultIntegrations ( options : NativescriptClientOptions & NativescriptOptions ) : Integration [ ] {
34
34
const integrations : Integration [ ] = [ ] ;
35
+ const iteratee = ( frame : StackFrame ) => {
36
+ if ( frame . platform === 'javascript' && frame . filename ) {
37
+ let filename = frame . filename
38
+ . replace ( / ^ f i l e \: \/ \/ / , '' )
39
+ . replace ( / ^ a d d r e s s a t / , '' )
40
+ . replace ( / ^ .* \/ [ ^ \. ] + ( \. a p p | C o d e P u s h | .* (? = \/ ) ) / , '' ) ;
35
41
36
- rewriteFrameIntegration = new RewriteFrames ( {
37
- iteratee : ( frame : StackFrame ) => {
38
- if ( frame . platform === 'javascript' && frame . filename ) {
39
- let filename = frame . filename
40
- . replace ( / ^ f i l e \: \/ \/ / , '' )
41
- . replace ( / ^ a d d r e s s a t / , '' )
42
- . replace ( / ^ .* \/ [ ^ \. ] + ( \. a p p | C o d e P u s h | .* (? = \/ ) ) / , '' ) ;
43
-
44
- if ( frame . filename . indexOf ( '[native code]' ) === - 1 ) {
45
- const appPrefix = options . appPrefix ?? '~/' ;
46
- if ( appPrefix . endsWith ( '//' ) && ! appPrefix . endsWith ( '///' ) ) {
47
- filename = filename . indexOf ( '/' ) === 0 ? `${ appPrefix } ${ filename } ` : `${ appPrefix } /${ filename } ` ;
48
- } else {
49
- filename = filename . indexOf ( '/' ) === 0 ? `${ appPrefix } ${ filename . slice ( 1 ) } ` : `${ appPrefix } ${ filename } ` ;
50
- }
42
+ if ( frame . filename . indexOf ( '[native code]' ) === - 1 ) {
43
+ const appPrefix = options . appPrefix ?? '~/' ;
44
+ if ( appPrefix . endsWith ( '//' ) && ! appPrefix . endsWith ( '///' ) ) {
45
+ filename = filename . indexOf ( '/' ) === 0 ? `${ appPrefix } ${ filename } ` : `${ appPrefix } /${ filename } ` ;
46
+ } else {
47
+ filename = filename . indexOf ( '/' ) === 0 ? `${ appPrefix } ${ filename . slice ( 1 ) } ` : `${ appPrefix } ${ filename } ` ;
51
48
}
49
+ }
52
50
53
- frame . filename = filename ;
54
- if ( options . colnoOffset ) {
55
- frame . colno += options . colnoOffset ;
56
- }
57
- // We always want to have a tripple slash
51
+ frame . filename = filename ;
52
+ if ( options . colnoOffset ) {
53
+ frame . colno += options . colnoOffset ;
58
54
}
59
- return frame ;
55
+ // We always want to have a tripple slash
60
56
}
57
+ return frame ;
58
+ } ;
59
+
60
+ rewriteFrameIntegration = new RewriteFrames ( {
61
+
61
62
} ) as any ;
63
+ rewriteFrameIntegration . _iteratee = iteratee ;
62
64
63
65
// if (notWeb()) {
64
66
integrations . push (
0 commit comments