Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-prop-types

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-prop-types - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.1.1](https://github.com/ivangabriele/better-prop-types/compare/v1.1.0...v1.1.1) (2022-01-25)
### Bug Fixes
* replace chainable type binding with factory ([47bfd65](https://github.com/ivangabriele/better-prop-types/commit/47bfd65f0e8a1e64f30143d28605b73f89fb2a12))
# [1.1.0](https://github.com/ivangabriele/better-prop-types/compare/v1.0.0...v1.1.0) (2022-01-25)

@@ -2,0 +9,0 @@

12

dist/index.js
import PropTypes from 'prop-types';
function createBetterChainableTypeChecker(validate) {
function checkType(is, props, propName, componentName, location, propFullName, ...rest) {
const makeCheckType = (is) => (props, propName, componentName, location, propFullName, ...rest) => {
const finalPropFullName = propFullName !== null ? propFullName : propName;

@@ -33,7 +33,7 @@ const propValue = props[propName];

}
}
const chainedCheckType = Object.assign(checkType.bind(null, undefined), {
isOptionalButNotNull: checkType.bind(null, 'UNNULLABLE'),
isRequired: checkType.bind(null, 'REQUIRED'),
isRequiredButNullable: checkType.bind(null, 'NULLABLE'),
};
const chainedCheckType = Object.assign(makeCheckType(), {
isOptionalButNotNull: makeCheckType('UNNULLABLE'),
isRequired: makeCheckType('REQUIRED'),
isRequiredButNullable: makeCheckType('NULLABLE'),
});

@@ -40,0 +40,0 @@ return chainedCheckType;

{
"name": "better-prop-types",
"description": "Better PropTypes.",
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc