New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tsarch

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsarch - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

dist/src/slices/projection/slicingProjections.spec.d.ts

17

dist/src/slices/projection/slicingProjections.js

@@ -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) {

12

dist/test/slices/integration/integration.spec.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc