Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
extended-proptypes
Advanced tools
Useful proptypes for React components. Developed for and tested on ClassDojo's web app.
Call the exported function on the standard React proptypes
object.
import {PropTypes} from "react";
import ExtendPropTypes from "extended-proptypes";
ExtendPropTypes(PropTypes);
New options will now be available on React's PropTypes
export.
import {Component, PropTypes} from "react";
class MyComponent extends Component {
static propTypes = {
myDate: PropTypes.date,
mySatanicString: PropTypes.stringMatching(/^6+$/).isRequired,
myArrayOrObject: PropTypes.iterableOf(PropTypes.bool),
};
}
All validators expose basic and isRequired
versions.
iterable
: An array or an object.iterableOf(validator)
: An array or object whose values match the provided validator.keyedObject(regex)
: An object whose keys match the provided regex.keyedObjectOf(regex, validator)
: An object whose keys match the provided regex and whose values match the provided validator.stringMatching(regex)
: A string that matches the provided regex.stringWithLength(min, max=Infinity)
: A string with length between min and max.time
: A value parsable by new Date()
.uuid
: A uuid string.locale
: A locale string, like en-US
or jp
emailAddress
: An email address (regex taken from the highest-upvoted SO answer)percent
: A percentage.cssLength
: A single css length, like 24px
, 43%
or 4rem
.cssSize
: Between 1 and 4 css sizes.color
: A hex or rgb(a) stringmongoId
: A 24-character hex string.mongoIdKeyedObject
: An object whose keys are mongo ids.mongoIdKeyedObjectOf(validator)
: An object whose keys are mongo ids and whose values match the provided validator.FAQs
Useful proptypes for react components
The npm package extended-proptypes receives a total of 12,926 weekly downloads. As such, extended-proptypes popularity was classified as popular.
We found that extended-proptypes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.