Comparing version 5.1.0 to 5.1.1
@@ -33,6 +33,19 @@ "use strict"; | ||
function sliceByPattern(pattern) { | ||
var regexp = pattern.replace("(**)", "([\\w].+)"); | ||
return sliceByRegex(new RegExp("^" + regexp)); | ||
var index = pattern.indexOf("(**)"); | ||
if (index === -1) { | ||
throw new Error("Could not find '(**)' inside slice pattern. It should contain exactly one occurance'(**)'"); | ||
} | ||
var prefix = escapeForRegexp(pattern.substr(0, index)); | ||
var unescapedSuffix = pattern.substr(index + 4, pattern.length); | ||
if (unescapedSuffix.indexOf("(**)") !== -1) { | ||
throw new Error("Found too many '(**)' inside slice pattern. It should contain exactly one occurance'(**)'"); | ||
} | ||
var suffix = escapeForRegexp(unescapedSuffix); | ||
var regexp = "^" + prefix + "([\\w]+)" + suffix + ".*$"; | ||
return sliceByRegex(new RegExp(regexp)); | ||
} | ||
exports.sliceByPattern = sliceByPattern; | ||
function escapeForRegexp(input) { | ||
return input.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); | ||
} | ||
function sliceByRegex(regexp) { | ||
@@ -39,0 +52,0 @@ return function slice(edge) { |
@@ -68,3 +68,3 @@ "use strict"; | ||
{ | ||
source: "src/services/Service.ts", | ||
source: "src/services/util/Service.ts", | ||
target: "src/controllers/Controller.ts", | ||
@@ -87,3 +87,3 @@ external: false | ||
case 1: | ||
graph = (_a.sent()); | ||
graph = _a.sent(); | ||
mapFunction = slicingProjections_1.sliceByPattern("src/facades/(**)/"); | ||
@@ -131,3 +131,3 @@ sliced = projectEdges_1.projectEdges(graph, mapFunction); | ||
{ | ||
source: "src/services/Service.ts", | ||
source: "src/services/util/Service.ts", | ||
target: "src/controllers/Controller.ts", | ||
@@ -165,3 +165,3 @@ external: false | ||
{ | ||
source: "src/services/Service.ts", | ||
source: "src/services/util/Service.ts", | ||
target: "src/controllers/Controller.ts", | ||
@@ -183,3 +183,3 @@ external: false | ||
case 1: | ||
graph = (_a.sent()); | ||
graph = _a.sent(); | ||
mapFunction = slicingProjections_1.sliceByFileSuffix(new Map([ | ||
@@ -206,3 +206,3 @@ ["Controller", "controllers"], | ||
case 1: | ||
graph = (_a.sent()); | ||
graph = _a.sent(); | ||
mapFunction = slicingProjections_1.sliceByPattern("src/(**)/"); | ||
@@ -209,0 +209,0 @@ reducedGraph = projectEdges_1.projectEdges(graph, mapFunction); |
@@ -1,1 +0,1 @@ | ||
import "../services/Service"; | ||
import "../services/util/Service"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("../services/Service"); | ||
require("../services/util/Service"); | ||
//# sourceMappingURL=Controller.js.map |
{ | ||
"name": "tsarch", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
211558
159
3047