UNPKG

react-shields.io

Version:

Shields.io for react component, Quality metadata badges for open source projects.

70 lines (52 loc) 2.7 kB
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _inherits from "@babel/runtime/helpers/esm/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } import Base from '../common/Base'; var Activity = /*#__PURE__*/function (_Base) { _inherits(Activity, _Base); var _super = _createSuper(Activity); function Activity(props) { var _this; _classCallCheck(this, Activity); _this = _super.call(this, props, { platform: 'github', type: 'commits-since' }); _this.getUrl = function () { var _this$state = _this.state, type = _this$state.type, platform = _this$state.platform, user = _this$state.user, repo = _this$state.repo, base = _this$state.base, interval = _this$state.interval, variant = _this$state.variant, version = _this$state.version, branch = _this$state.branch; if (platform !== 'github') return ''; if (type === 'commits-since' && version && branch) { return [base, platform, type, user, repo, version, branch].join('/'); } if (type === 'commit-activity' && interval) { return [base, platform, type, interval, user, repo].join('/'); } if (type === 'variant' && variant) { return [base, platform, type, variant, user, repo].join('/'); } if (type === 'last-commit') { return branch ? [base, platform, type, user, repo, branch].join('/') : [base, platform, type, user, repo].join('/'); } if (type && /^release\-(date|date\-pre)/.test(type)) { return [base, platform, type, user, repo].join('/'); } return ''; }; return _this; } return Activity; }(Base); export { Activity as default }; //# sourceMappingURL=Activity.js.map