UNPKG

931 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.hasDocgen = hasDocgen;
7exports.isValidDocgenSection = isValidDocgenSection;
8exports.getDocgenSection = getDocgenSection;
9exports.getDocgenDescription = getDocgenDescription;
10
11require("core-js/modules/es.object.keys.js");
12
13require("core-js/modules/es.symbol.js");
14
15require("core-js/modules/es.symbol.description.js");
16
17var _string = require("./string");
18
19/* eslint-disable no-underscore-dangle */
20function hasDocgen(component) {
21 return !!component.__docgenInfo;
22}
23
24function isValidDocgenSection(docgenSection) {
25 return docgenSection != null && Object.keys(docgenSection).length > 0;
26}
27
28function getDocgenSection(component, section) {
29 return hasDocgen(component) ? component.__docgenInfo[section] : null;
30}
31
32function getDocgenDescription(component) {
33 return hasDocgen(component) && (0, _string.str)(component.__docgenInfo.description);
34}
\No newline at end of file