Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
removing filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jain, Sneha T authored and darkwing committed Feb 15, 2019
1 parent d40bc5d commit 50e878b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"react-transition-group": "^2.2.1",
"reselect": "^4.0.0",
"svg-inline-react": "^3.0.0",
"wasmparser": "^0.7.0"
"wasmparser": "^0.7.0",
"whatwg-url": "^7.0.0"
},
"private": true,
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions src/utils/sources-tree/addToTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function traverseTree(
tree: TreeDirectory,
debuggeeHost: ?string
): TreeNode {
const parts = url.path.split("/").filter(p => p !== "");
parts.unshift(url.group);
const parts = url.path.replace(/\/$/, "").split("/");
parts[0] = url.group;

let path = "";
return parts.reduce((subTree, part, index) => {
Expand Down
12 changes: 11 additions & 1 deletion src/utils/sources-tree/tests/getUrl.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,20 @@ describe("getUrl", () => {
it("creates a group name for webpack", () => {
const urlObject = getURL(
createMockSource({
url: "webpack://src/component.jsx",
url: "webpack:///src/component.jsx",
id: "c3"
})
);
expect(urlObject.group).toBe("webpack://");
});

it("creates a group name for angular source", () => {
const urlObject = getURL(
createMockSource({
url: "ng://src/component.jsx",
id: "c3"
})
);
expect(urlObject.group).toBe("ng://");
});
});
1 change: 1 addition & 0 deletions src/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// @flow

import { memoize } from "lodash";
import { URL } from "whatwg-url";

const defaultUrl = {
hash: "",
Expand Down

0 comments on commit 50e878b

Please sign in to comment.