@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
22 lines (17 loc) • 731 B
JavaScript
/**
* MSKCC 2021, 2024
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
function requiredIfGivenPropIsTruthyV2(name, propType) {
return function check(props, propName, componentName) {
if (process.env.NODE_ENV !== "production" && props[name] === true && props[propName] == null) {
return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` is true.`);
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return propType(props, propName, componentName, ...rest);
};
}
exports["default"] = requiredIfGivenPropIsTruthyV2;