Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.getFunctionName = getFunctionName;
  6. exports.default = void 0;
  7. // Fork of recompose/getDisplayName with added IE 11 support
  8. // Simplified polyfill for IE 11 support
  9. // https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
  10. var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
  11. function getFunctionName(fn) {
  12. var match = "".concat(fn).match(fnNameMatchRegex);
  13. var name = match && match[1];
  14. return name || '';
  15. }
  16. function getDisplayName(Component) {
  17. if (typeof Component === 'string') {
  18. return Component;
  19. }
  20. if (!Component) {
  21. return undefined;
  22. }
  23. return Component.displayName || Component.name || getFunctionName(Component) || 'Component';
  24. }
  25. var _default = getDisplayName;
  26. exports.default = _default;