
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
TypeScript Type Flattening Tool | Recursively parses complex types and generates nested JSON or type declarations.
type-flat is a TypeScript type flattening tool that recursively parses complex types, including generics, nested objects, and intersection types, and generates structured nested type definitions. It is suitable for:
Response<User>.d.ts type declarationsnpm install type-flat
# or
pnpm add type-flat
npx type-flat <file> <typeName>
<file>: Path to the TypeScript file (.ts or .d.ts)<typeName>: Type or interface name to flattenExample
npx type-flat -f example/types.ts -t ResponseOfUser
Output:
{
"code": "number",
"message": "string",
"data": {
"id": "number",
"name": "string",
"profile": {
"email": "string",
"address": {
"city": "string",
"zip": "number"
}
}
}
}
import { flatten } from 'type-flat';
import Content from './types.d.ts'
const result = await flatten(Content, 'ResponseOfUser');
console.log(JSON.stringify(result, null, 2));
types.ts:
export interface Address { city: string; zip: number; }
export interface Profile { email: string; address: Address; }
export interface User { id: number; name: string; profile: Profile; }
export interface Response<T> { code: number; message: string; data: T; }
export type ResponseOfUser = Response<User>;
Usage:
import { flatten } from 'type-flat';
const res = await flatten(Content, 'ResponseOfUser');
console.log(res);
Output:
{
"code": "number",
"message": "string",
"data": {
"id": "number",
"name": "string",
"profile": {
"email": "string",
"address": {
"city": "string",
"zip": "number"
}
}
}
}
.d.ts filesApache-2.0 © 2025 hboot
FAQs
TypeScript Type Flattening Tool
We found that type-flat 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.