Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@definitelytyped/dts-critic
Advanced tools
Checks a new .d.ts against the Javascript source and tells you what problems it has
Checks a new dts against the Javascript sources and tells you what problems it has.
Build the program:
$ npm run build
Run the program using node:
$ node dist/index.js --dts=path-to-d.ts [--js=path-to-source] [--mode=mode] [--debug]
If the d.ts path is to a file named index.d.ts
, the name of the directory
will be used as the package name instead. For example
~/dt/types/jquery/index.d.ts
will use jquery
as the name.
path-to-source
is optional; if you leave it off, the code will
check npm for a package with the same name as the d.ts.
You can run dts-critic in different modes that affect which checks will be performed:
name-only
: dts-critic will check your package name and DefinitelyTyped header (if present) against npm packages.
For example, if your declaration is for an npm package called 'cool-js-package', it will check if a
package named 'cool-js-package' actually exists in npm.
code
: in addition to the checks performed in name-only
mode, dts-critic will check if your
declaration exports match the source JavaScript module exports.
For example, if your declaration has a default export, it will check if the JavaScript module also
has a default export.
If your declaration is for an npm package:
code
mode, your declaration must also match the source JavaScript module.If your declaration is for a non-npm package (in other words, if your declaration has a Definitely Typed header and the header specifies that the declaration file is for a non-npm package):
code
mode and a path to the JavaScript source file was provided, your
declaration must also match the source JavaScript module.Note that for real use on Definitely Typed, a lot of these checks need to be pretty loose.
$ node dist/dt.js
Will run dts-critic on every directory inside ../DefinitelyTyped
and
print errors.
The tests use the Jest framework. To build and execute the tests, run:
$ npm run test
This will build the program and run jest.
FAQs
Checks a new .d.ts against the Javascript source and tells you what problems it has
The npm package @definitelytyped/dts-critic receives a total of 47,719 weekly downloads. As such, @definitelytyped/dts-critic popularity was classified as popular.
We found that @definitelytyped/dts-critic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.