@@ -22,19 +22,6 @@ import type { ParsedURL } from "./getURL";
2222import type { Node } from "./types" ;
2323import type { SourceRecord } from "../../types" ;
2424
25- function isUnderRoot ( url , projectRoot ) {
26- if ( ! projectRoot ) {
27- return true ;
28- }
29-
30- return `${ url . group } ${ url . path } ` . startsWith ( projectRoot ) ;
31- }
32-
33- function removeProjectRoot ( parts , projectRoot ) {
34- const rootParts = projectRoot . replace ( "://" , "" ) . split ( "/" ) ;
35- return parts . splice ( 0 , rootParts . length - 2 ) ;
36- }
37-
3825function createNodeInTree (
3926 part : string ,
4027 path : string ,
@@ -95,21 +82,12 @@ function findOrCreateNode(
9582 * walk the source tree to the final node for a given url,
9683 * adding new nodes along the way
9784 */
98- function traverseTree (
99- url : Object ,
100- tree : Node ,
101- debuggeeHost : ?string ,
102- projectRoot : string
103- ) {
85+ function traverseTree ( url : Object , tree : Node , debuggeeHost : ?string ) {
10486 url . path = decodeURIComponent ( url . path ) ;
10587
10688 const parts = url . path . split ( "/" ) . filter ( p => p !== "" ) ;
10789 parts . unshift ( url . group ) ;
10890
109- if ( projectRoot ) {
110- removeProjectRoot ( parts , projectRoot ) ;
111- }
112-
11391 let path = "" ;
11492 return parts . reduce ( ( subTree , part , index ) => {
11593 path = path ? `${ path } /${ part } ` : part ;
@@ -172,10 +150,10 @@ export function addToTree(
172150 const url = getURL ( source . get ? source . get ( "url" ) : source . url , debuggeeUrl ) ;
173151 const debuggeeHost = getDomain ( debuggeeUrl ) ;
174152
175- if ( isInvalidUrl ( url , source ) || ! isUnderRoot ( url , projectRoot ) ) {
153+ if ( isInvalidUrl ( url , source ) ) {
176154 return ;
177155 }
178156
179- const finalNode = traverseTree ( url , tree , debuggeeHost , projectRoot ) ;
157+ const finalNode = traverseTree ( url , tree , debuggeeHost ) ;
180158 finalNode . contents = addSourceToNode ( finalNode , url , source ) ;
181159}
0 commit comments