Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/components/responses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class Responses extends React.Component {
</thead>
<tbody>
{
responses.entrySeq().map( ([code, response]) => {
responses.filter((_, key) => !key.startsWith("x-")).entrySeq().map( ([code, response]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we rewrite and reuse logic from core/utils to filter extensions?

const extensionRegExp = /^x-/
export const isExtension = (key) => extensionRegExp.test(key)

export const getExtensions = (defObj) => {
  if(Map.isMap(defObj)) {
    return defObj.filter((v, k) => isExtension(k))
  }
  return Object.keys(defObj).filter((key) => isExtension(key))
}
Suggested change
responses.filter((_, key) => !key.startsWith("x-")).entrySeq().map( ([code, response]) => {
responses.filter((_, key) => !isExtension(key)).entrySeq().map( ([code, response]) => {


let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""
return (
Expand Down