Don't parse non-method path keys as operations
This commit is contained in:
@@ -4,6 +4,10 @@ import { fromJS, Set, Map, OrderedMap, List } from "immutable"
|
|||||||
|
|
||||||
const DEFAULT_TAG = "default"
|
const DEFAULT_TAG = "default"
|
||||||
|
|
||||||
|
const OPERATION_METHODS = [
|
||||||
|
"get", "put", "post", "delete", "options", "head", "patch", "trace"
|
||||||
|
]
|
||||||
|
|
||||||
const state = state => {
|
const state = state => {
|
||||||
return state || Map()
|
return state || Map()
|
||||||
}
|
}
|
||||||
@@ -95,6 +99,9 @@ export const operations = createSelector(
|
|||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
path.forEach((operation, method) => {
|
path.forEach((operation, method) => {
|
||||||
|
if(OPERATION_METHODS.indexOf(method) < 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
list = list.push(fromJS({
|
list = list.push(fromJS({
|
||||||
path: pathName,
|
path: pathName,
|
||||||
method,
|
method,
|
||||||
|
|||||||
Reference in New Issue
Block a user