react-shields.io
Version:
react-shields.io ===
61 lines (46 loc) • 2.6 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
import Base from '../common/Base';
var Issue =
/*#__PURE__*/
function (_Base) {
_inherits(Issue, _Base);
function Issue(props) {
var _this;
_classCallCheck(this, Issue);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Issue).call(this, _objectSpread({
platform: 'github',
type: 'issues'
}, props)));
_this.getUrl = function () {
var _this$state = _this.state,
type = _this$state.type,
platform = _this$state.platform,
property = _this$state.property,
user = _this$state.user,
repo = _this$state.repo,
label = _this$state.label,
base = _this$state.base;
if (platform !== 'github') return '';
if (type === 'issues' || /^issues\-(raw|closed|closed\-raw|pr|pr\-raw|pr\-closed|pr\-closed\-raw)/.test(type)) {
if (label && (type === 'issues' || /^issues\-(raw|pr|pr\-raw)/.test(type || ''))) {
return [base, platform, type, user, repo, label].join('/');
}
return [base, platform, type, user, repo].join('/');
}
if (type === 'issueKind') {
return [base, platform, type, 'detail', property, user, repo].join('/');
}
return '';
};
return _this;
}
return Issue;
}(Base);
export { Issue as default };
//# sourceMappingURL=Issues.js.map