Socket
Book a DemoInstallSign in
Socket

tsst-tycho

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsst-tycho - npm Package Compare versions

Comparing version

to
0.3.8

5

dist/BlockTransformer.js

@@ -52,4 +52,2 @@ "use strict";

});
// Error.stackTraceLimit = 0;
const traceStatement = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("Error"), "stackTraceLimit"), ts.createLiteral(0)));
const errors = containedDiagnostics.map(diagnostic => {

@@ -65,6 +63,5 @@ const errorExpression = ts.createNew(ts.createIdentifier("Error"), [], [ts.createLiteral(typeof diagnostic.messageText === "string" ?

const returnStatement = ts.createReturn(ts.createArrayLiteral([], true));
const throwStatement = ts.createThrow(ts.createElementAccess(ts.createArrayLiteral(errors, true), ts.createLiteral(0)));
return ts.createBlock((errors.length ? [traceStatement, throwStatement] : [returnStatement]), true);
return ts.createBlock([returnStatement], true);
}
}
exports.BlockTransformer = BlockTransformer;

15

dist/index.js

@@ -30,8 +30,11 @@ "use strict";

expectToCompile() {
if (this.errors.length)
throw this.errors[0].message;
if (this.errors.length) {
Error.stackTraceLimit = 0;
throw this.errors[0];
}
},
expectToFail() {
if (!this.errors.length) {
`No semantic failures`;
Error.stackTraceLimit = 0;
throw new Error(`No semantic failures`);
}

@@ -41,6 +44,8 @@ },

if (!this.errors.length) {
`No matching semantic failures, expected "${msg}"!`;
Error.stackTraceLimit = 0;
throw new Error(`No matching semantic failures, expected "${msg}"!`);
}
else if (this.errors.filter(e => RegExp(msg).test(e.message)).length === 0) {
`Expected failure "${msg}", got failure "${this.errors[0]}"!`;
Error.stackTraceLimit = 0;
throw new Error(`Expected failure "${msg}", got failure "${this.errors[0]}"!`);
}

@@ -47,0 +52,0 @@ }

@@ -6,3 +6,3 @@ {

"license": "ISC",
"version": "0.3.7",
"version": "0.3.8",
"main": "./dist/index.js",

@@ -9,0 +9,0 @@ "types": "./dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.