Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ts-declaration-location
Advanced tools
Any donations would be much appreciated. 😄
ts-declaration-location
is available as part of the Tidelift Subscription.
Tidelift is working with the maintainers of ts-declaration-location
and a growing network of open source maintainers
to ensure your open source software supply chain meets enterprise standards now and into the future.
Learn more.
# Install with npm
npm install ts-declaration-location
# Install with pnpm
pnpm add ts-declaration-location
# Install with yarn
yarn add ts-declaration-location
# Install with bun
`bun add ts-declaration-location
# Install in a node project
npx jsr add @rebeccastevens/ts-declaration-location
# Install in a deno project
deno add jsr:@rebeccastevens/ts-declaration-location
# Install in a bun project
bunx jsr add @rebeccastevens/ts-declaration-location
import typeMatchesSpecifier from "ts-declaration-location";
import type ts from "typescript";
function isTypeFromSomePackage(program: ts.Program, type: ts.Type) {
const specifier = {
from: "package",
package: "some-package",
};
return typeMatchesSpecifier(program, specifier, type);
}
function isTypeFromSomeFile(program: ts.Program, type: ts.Type) {
const specifier = {
from: "file",
path: "src/**/some.ts",
};
return typeMatchesSpecifier(program, specifier, type);
}
function isTypeFromTSLib(program: ts.Program, type: ts.Type) {
const specifier = {
from: "lib",
};
return typeMatchesSpecifier(program, specifier, type);
}
FAQs
Determine where a ts type declaration comes from
We found that ts-declaration-location demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.