react-highlighter
Version:
Highlight select fragments of texts
13 lines (10 loc) • 387 B
JavaScript
var regExpPropType = function (props, propName, componentName, location) {
if (!(props[propName] instanceof RegExp)) {
var propType = typeof props[propName];
return new Error(
("Invalid " + location + " `" + propName + "` of type `" + propType + "` ") +
("supplied to `" + componentName + "`, expected `RegExp`.")
);
}
};
module.exports = regExpPropType;