26 lines
753 B
JavaScript
26 lines
753 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
// weak
|
|
var requirePropFactory = function requirePropFactory(componentNameInError) {
|
|
var requireProp = function requireProp(requiredProp) {
|
|
return function (props, propName, componentName, location, propFullName) {
|
|
var propFullNameSafe = propFullName || propName;
|
|
|
|
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
|
|
return new Error("The property `".concat(propFullNameSafe, "` of ") + "`".concat(componentNameInError, "` must be used on `").concat(requiredProp, "`."));
|
|
}
|
|
|
|
return null;
|
|
};
|
|
};
|
|
|
|
return requireProp;
|
|
};
|
|
|
|
var _default = requirePropFactory;
|
|
exports.default = _default; |