
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@laziness/dts-gen
Advanced tools
Generate dts types from React prop types source code.
yarn add @laziness/dts-gen
npm install @laziness/dts-gen
We have a React source code:
import React from 'react';
import PropTypes from 'prop-types';
const Sample = () => <div>Hi!</div>;
Sample.propTypes = {
any: PropTypes.any,
isVisible: PropTypes.bool.isRequired,
index: PropTypes.number,
string: PropTypes.string,
object: PropTypes.object,
element: PropTypes.element,
children: PropTypes.node,
products: PropTypes.array,
messages: PropTypes.arrayOf(PropTypes.string),
onChange: PropTypes.func.isRequired,
status: PropTypes.oneOf(['active', 'inactive', 'blocked']),
nameOrAge: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
user: PropTypes.shape({
name: PropTypes.string,
age: PropTypes.number,
}).isRequired,
};
export default Sample;
Then we pass the source code to the generate dts:
import { generate } from '@laziness/dts-gen';
generate(sourceCode);
The generated dts looks like this:
type User = {
name?: string;
age?: number;
};
type Sample = {
any?: any;
isVisible: boolean;
index?: number;
string?: string;
object?: object;
element?: React.ReactElement<any>;
children?: React.ReactNode;
products?: any[];
messages?: string[];
onChange: () => void;
status?: 'active' | 'inactive' | 'blocked';
nameOrAge?: string | number;
user: User;
};
FAQs
Generate dts types from React prop types source code.
We found that @laziness/dts-gen demonstrated a not healthy version release cadence and project activity because the last version was released 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
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.