pre-installations and preparations

This commit is contained in:
MuhammadKhalilzadeh committed 2024-05-05 11:21:00 +03:30
1 parent 3e5a0329cb
commit 201d621ac3
6977 files changed
+742826

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
import { ValidationMap } from 'prop-types';
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
+20
View File
@@ -0,0 +1,20 @@
import _extends from "@babel/runtime/helpers/esm/extends";
// This module is based on https://github.com/airbnb/prop-types-exact repository.
// However, in order to reduce the number of dependencies and to remove some extra safe checks
// the module was forked.
const specialProperty = 'exact-prop: \u200b';
export default function exactProp(propTypes) {
if (process.env.NODE_ENV === 'production') {
return propTypes;
}
return _extends({}, propTypes, {
[specialProperty]: props => {
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
if (unsupportedProps.length > 0) {
return new Error(`The following props are not supported: ${unsupportedProps.map(prop => `\`${prop}\``).join(', ')}. Please remove them.`);
}
return null;
}
});
}
+1
View File
@@ -0,0 +1 @@
export { default } from './exactProp';
+1
View File
@@ -0,0 +1 @@
export { default } from './exactProp';
+6
View File
@@ -0,0 +1,6 @@
{
"sideEffects": false,
"module": "./index.js",
"main": "../node/exactProp/index.js",
"types": "./index.d.ts"
}