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

dtslint

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dtslint - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

9

bin/index.js

@@ -182,3 +182,3 @@ #!/usr/bin/env node

if (minVersionFromComment !== undefined && inTypesVersionDirectory) {
throw new Error(`Already in the \`ts${lowVersion}\` directory, don't need \`// TypeScript Version\`.`);
throw new Error(`Already in the \`ts${lowVersion}\` directory, don't need \`// Minimum TypeScript Version\`.`);
}

@@ -223,8 +223,7 @@ const minVersion = lowVersion

function getTypeScriptVersionFromComment(text) {
const searchString = "// TypeScript Version: ";
const x = text.indexOf(searchString);
if (x === -1) {
const match = text.match(/\/\/ (?:Minimum)? TypeScript Version: /);
if (!match) {
return undefined;
}
let line = text.slice(x, text.indexOf("\n", x));
let line = text.slice(match.index, text.indexOf("\n", match.index));
if (line.endsWith("\r")) {

@@ -231,0 +230,0 @@ line = line.slice(0, line.length - 1);

@@ -32,2 +32,3 @@ "use strict";

lookFor("// TypeScript Version", "TypeScript version should be specified under header in `index.d.ts`.");
lookFor("// Minimum TypeScript Version", "TypeScript version should be specified under header in `index.d.ts`.");
return;

@@ -34,0 +35,0 @@ }

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

? "TypeScript@next features not yet supported."
: `Fix with a comment '// TypeScript Version: ${nextHigherVersion}' just under the header.`;
: `Fix with a comment '// Minimum TypeScript Version: ${nextHigherVersion}' just under the header.`;
return msg + explain;

@@ -174,0 +174,0 @@ }

{
"name": "dtslint",
"version": "2.0.3",
"version": "2.0.4",
"description": "Runs tests on TypeScript definition files",

@@ -5,0 +5,0 @@ "files": [

@@ -112,3 +112,3 @@ `dtslint` tests a TypeScript declaration file for style and correctness.

```ts
// TypeScript Version: 2.1
// Minimum TypeScript Version: 2.1
```

@@ -115,0 +115,0 @@

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

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