Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Jan 11, 2021
1 parent df2a3cf commit 894de5f
Show file tree
Hide file tree
Showing 6 changed files with 15,404 additions and 2,119 deletions.
2 changes: 1 addition & 1 deletion lib/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getMock(basePath, file, data = undefined) {
if (matchParams) {
params = matchParams[1]
.split('&')
.map(decodeURIComponent)
.map((value) => decodeURIComponent(value))
.reduce((acc, value) => {
const param = value.split('=');
acc[param[0]] = param[1];
Expand Down
8 changes: 3 additions & 5 deletions lib/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ async function record(req, res, data, options) {
data
};

if (options.collection) {
await appendToMockCollection(mock, path.join(options.basePath, options.collection));
} else {
await writeMock(mock, options.basePath, options.depth);
}
await (options.collection
? appendToMockCollection(mock, path.join(options.basePath, options.collection))
: writeMock(mock, options.basePath, options.depth));
} catch (error) {
console.error(`Cannot save mock: ${error && error.message}`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function processRequest(options) {
} else {
const sortedMatches = matches.sort((a, b) => b.score - a.score);
const accept = req.accepts(sortedMatches.map((match) => match.mock.type));
const {match, mock} = sortedMatches.filter((match) => accept === match.mock.type)[0];
const {match, mock} = sortedMatches.find((match) => accept === match.mock.type);

// Fill in route params
mock.keys.forEach((key, index) => {
Expand Down
Loading

0 comments on commit 894de5f

Please sign in to comment.