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

ts-expect-error-validator

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-expect-error-validator - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

14

dist/utils/sources/fileParser.js

@@ -9,3 +9,3 @@ "use strict";

const tsExpectedErrors = [];
const groupedTsExpectedErrors = [];
let tsExpectedErrorLine = '';
let lineNumber = 0;

@@ -19,8 +19,6 @@ for await (const line of (0, fileReader_1.fileReader)(filePath)) {

if (lineEndsWithTsError === true && tsExpectedLineErrorsInfo !== null) {
groupedTsExpectedErrors.push(tsExpectedLineErrorsInfo);
tsExpectedErrorLine = tsExpectedLineErrorsInfo;
}
if (groupedTsExpectedErrors.length > 0 && isComment === false) {
const expectedErrors = groupedTsExpectedErrors
.join(',')
.split(',');
if (tsExpectedErrorLine.length > 0 && isComment === false) {
const expectedErrors = tsExpectedErrorLine.split(',');
for (const expectedError of expectedErrors) {

@@ -35,7 +33,7 @@ const [code, message] = expectedError.trim().split('-');

}
groupedTsExpectedErrors.length = 0;
tsExpectedErrorLine = '';
continue;
}
if (hasTsError === true) {
groupedTsExpectedErrors.push(tsExpectedLineErrorsInfo ?? '');
tsExpectedErrorLine = tsExpectedLineErrorsInfo ?? ' ';
}

@@ -42,0 +40,0 @@ }

@@ -8,4 +8,3 @@ "use strict";

const trimmedLine = line.replaceAll(' ', '');
const isComment = trimmedLine.startsWith('#') ||
trimmedLine.startsWith('//') ||
const isComment = trimmedLine.startsWith('//') ||
trimmedLine.startsWith('/**') ||

@@ -23,3 +22,3 @@ trimmedLine.startsWith('*');

}
const cleanedLine = trimmedLine.replaceAll('//', '').replaceAll('*', '');
const cleanedLine = trimmedLine.replaceAll('//', '');
const lineStartsWithTsError = cleanedLine.startsWith(constants_1.TS_EXPECT_ERROR) ||

@@ -30,4 +29,3 @@ cleanedLine.substring(1).startsWith(constants_1.TS_EXPECT_ERROR);

.split('[')[1]
?.split(']')[0]
?.trim();
?.split(']')[0];
return {

@@ -34,0 +32,0 @@ lineStartsWithTsError,

{
"name": "ts-expect-error-validator",
"version": "0.0.2",
"version": "0.0.3",
"author": "pashak09",

@@ -17,2 +17,6 @@ "description": "",

],
"repository": {
"type": "git",
"url": "https://github.com/pashak09/ts-expect-error-validator"
},
"bin": {

@@ -19,0 +23,0 @@ "ts-expect-error-validator": "dist/cli.js"

@@ -5,4 +5,4 @@ <p align="center">

</a>
<a href="https://coveralls.io/github/pashak09/ts-expect-error-validator?branch=main">
<img src="https://coveralls.io/repos/github/pashak09/ts-expect-error-validator/badge.svg?branch=main" alt="Coverage Status" />
<a href="https://coveralls.io/github/pashak09/ts-expect-error-validator?branch=master">
<img src="https://coveralls.io/repos/github/pashak09/ts-expect-error-validator/badge.svg?branch=master" alt="Coverage Status" />
</a>

@@ -9,0 +9,0 @@ <a href="https://www.npmjs.com/package/ts-expect-error-validator">

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