@danilandreev/material-docs
Version:
material-docs - react framework for easy creating documentation site in material design style.
40 lines (31 loc) • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.appBarActionValidate = appBarActionValidate;
exports.default = void 0;
var _createChainableTypeChecker = _interopRequireDefault(require("../utils/createChainableTypeChecker"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* appBarActionValidate - type validator for AppBarAction interface. Used in PagesDataValidator.
* @function
* @param {object} props
* @param {string} propName
* @param {string} componentName
* @returns Error
*/
function appBarActionValidate(prop, propName, componentName) {
if (typeof prop.label !== "string") return Error("Incorrect field 'label' type on prop ".concat(propName, " in component ").concat(componentName, ", expected \"string\", got \"").concat(_typeof(prop.label), "\""));
if (typeof prop.link !== "string") return Error("Incorrect field 'link' type on prop ".concat(propName, " in component ").concat(componentName, ", expected \"string\", got \"").concat(_typeof(prop.link), "\""));
}
function AppBarActionValidator(props, propName, componentName) {
var prop = props[propName];
if (!prop) return null;
return appBarActionValidate(prop, propName, componentName);
}
/**
* AppBarActionValidator - PropTypes validator for AppBarAction interface.
*/
var _default = (0, _createChainableTypeChecker.default)(AppBarActionValidator);
exports.default = _default;