Skip to content

Commit

Permalink
Small fix on parameter type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
TexKiller committed Dec 18, 2019
1 parent bc04ca6 commit 0fd5c09
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/feature/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ export default (files, matchers, definitions) => {
if (params) {
params.shift();
const types = params.map(param => {
let json;
try {
JSON.parse(param);
json = true;
} catch (e) {}
if (json) {
return 'json';
} else {
if (typeof param === "string") {
try {
JSON.parse(param);
return 'json';
} catch (e) {}
if (param.lastIndexOf('<') === 0 &&
param.indexOf('>') === param.length - 1) {
return 'example';
Expand Down

0 comments on commit 0fd5c09

Please sign in to comment.