better-prop-types
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -0,1 +1,8 @@ | ||
# [1.1.0](https://github.com/ivangabriele/better-prop-types/compare/v1.0.0...v1.1.0) (2022-01-25) | ||
### Features | ||
* use import type for typings ([83344bc](https://github.com/ivangabriele/better-prop-types/commit/83344bc871f366e1e7d3ff846df1bb4141a3659e)) | ||
# 1.0.0 (2021-11-22) | ||
@@ -2,0 +9,0 @@ |
@@ -34,6 +34,7 @@ import PropTypes from 'prop-types'; | ||
} | ||
const chainedCheckType = checkType.bind(null, false); | ||
chainedCheckType.isRequiredButNullable = checkType.bind(null, 'NULLABLE'); | ||
chainedCheckType.isRequired = checkType.bind(null, 'REQUIRED'); | ||
chainedCheckType.isOptionalButNotNull = checkType.bind(null, 'UNNULLABLE'); | ||
const chainedCheckType = Object.assign(checkType.bind(null, undefined), { | ||
isOptionalButNotNull: checkType.bind(null, 'UNNULLABLE'), | ||
isRequired: checkType.bind(null, 'REQUIRED'), | ||
isRequiredButNullable: checkType.bind(null, 'NULLABLE'), | ||
}); | ||
return chainedCheckType; | ||
@@ -40,0 +41,0 @@ } |
{ | ||
"name": "better-prop-types", | ||
"description": "Better PropTypes.", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -9,3 +9,3 @@ "type": "module", | ||
"exports": "./dist/index.js", | ||
"types": "./dist/src/index.d.ts", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
@@ -16,3 +16,3 @@ "build": "rm -Rf ./dist && rollup -c", | ||
"test:lint": "eslint --ext ts .", | ||
"test:type": "tsc --noEmit", | ||
"test:type": "tsc && tsc --noEmit --project ./tsconfig.dist.json", | ||
"test:unit": "jest" | ||
@@ -22,21 +22,23 @@ }, | ||
"@types/prop-types": "15.7.4", | ||
"prop-types": "15.7.2" | ||
"prop-types": "15.8.1" | ||
}, | ||
"devDependencies": { | ||
"@ivangabriele/commitlint-config": "1.0.2", | ||
"@ivangabriele/eslint-config-typescript-base": "2.1.1", | ||
"@commitlint/cli": "16.1.0", | ||
"@commitlint/config-conventional": "16.0.0", | ||
"@ivangabriele/commitlint-config": "1.0.5", | ||
"@ivangabriele/eslint-config-typescript-base": "2.1.4", | ||
"@ivangabriele/prettier-config": "2.0.2", | ||
"@ivangabriele/semantic-release-config-base": "1.1.3", | ||
"@ivangabriele/semantic-release-config-base": "1.3.0", | ||
"@rollup/plugin-commonjs": "21.0.1", | ||
"@rollup/plugin-node-resolve": "13.0.6", | ||
"@rollup/plugin-node-resolve": "13.1.3", | ||
"@rollup/plugin-typescript": "8.3.0", | ||
"@types/jest": "27.0.3", | ||
"@types/react": "17.0.35", | ||
"@types/jest": "27.4.0", | ||
"@types/react": "17.0.38", | ||
"codecov": "3.8.3", | ||
"husky": "7.0.4", | ||
"jest": "27.3.1", | ||
"jest": "27.4.7", | ||
"react": "17.0.2", | ||
"rollup": "2.60.0", | ||
"ts-jest": "27.0.7", | ||
"typescript": "4.5.2" | ||
"rollup": "2.66.1", | ||
"ts-jest": "27.1.3", | ||
"typescript": "4.5.5" | ||
}, | ||
@@ -43,0 +45,0 @@ "author": { |
@@ -8,6 +8,6 @@ # better-prop-types | ||
**better-prop-types** is a wrapper for the original **[prop-types][lnk-prop-types]** library adding a few more validators and | ||
modifiers to accurately handle `null` and `undefined` values (which shouldn't be considered similar!). | ||
**better-prop-types** is a wrapper for the original **[prop-types][lnk-prop-types]** library adding a few more | ||
validators and modifiers to accurately handle `null` and `undefined` values (which shouldn't be considered similar!). | ||
The code is fully test-covered and actively used in production. | ||
The code is fully test-covered and actively used in production. It also provides accurate Typescript declarations. | ||
@@ -62,4 +62,4 @@ The library includes the original `prop-types` as a dependency. | ||
- `objectOf(/* */).isRequiredButNullable` | ||
- `shape(/* */).isOptionalButNotNull` | ||
- `BetterPropsTypes.objectOf(/* */).isRequiredButNullable` | ||
- `BetterPropsTypes.shape(/* */).isOptionalButNotNull` | ||
- etc | ||
@@ -73,2 +73,3 @@ | ||
- `isRequiredForA11y(validator)` => `BetterPropsTypes.string.isRequiredForA11y` | ||
- Improve original error messages for arrays validated via functional validators with explicit property naming. | ||
@@ -75,0 +76,0 @@ --- |
Sorry, the diff of this file is not supported yet
84
27492
18
9
120
+ Addedprop-types@15.8.1(transitive)
- Removedprop-types@15.7.2(transitive)
Updatedprop-types@15.8.1