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

dts-critic

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dts-critic - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

21

index.js

@@ -21,8 +21,5 @@ const yargs = require("yargs");

const names = findNames(dtsPath, sourcePath, header)
const src = sourcePath ?
fs.readFileSync(require.resolve(sourcePath), "utf-8") :
download("https://unpkg.com/" + mangleScoped(names.src));
checkNames(names, header);
if (header && !header.nonNpm) {
checkSource(names.dts, dts, src);
checkSource(names.dts, dts, readSource(sourcePath, names.src, header));
}

@@ -63,2 +60,18 @@ }

/**
* @param {string | undefined} sourcePath
* @param {string} name
* @param {headerParser.Header | undefined} header
*/
function readSource(sourcePath, name, header) {
if (sourcePath) {
return fs.readFileSync(require.resolve(sourcePath), "utf-8");
}
let fullName = mangleScoped(name);
if (header) {
fullName += `@${header.libraryMajorVersion}.${header.libraryMinorVersion}`;
}
return download("https://unpkg.com/" + fullName);
}
/**
* Find package names of dts and source. Also finds the homepage from the DT header, if present.

@@ -65,0 +78,0 @@ * @param {string} dtsPath

2

package.json
{
"name": "dts-critic",
"version": "1.0.7",
"version": "1.0.8",
"author": "Nathan Shively-Sanders",

@@ -5,0 +5,0 @@ "description": "Checks a new .d.ts against the Javascript source and tells you what problems it has",

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