Skip to content

Commit

Permalink
fallback to empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Aug 26, 2024
1 parent 8377fb9 commit 560b6ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const utils = {
// HTTP method + ID + route name: POST1234/foo OR 1234/foo
// NOTE: http method GET is ingored in the compound id in order to preserve existing mocks
createCompoundId: (method, id, path) => {
return method.toLowerCase() === "get" ? id + path : method + id + path;
return method?.toLowerCase() === "get"
? id + path
: (method || "") + id + path;
},
objectToArray: (obj) => {
if (!obj || typeof obj !== "object") {
Expand Down

0 comments on commit 560b6ac

Please sign in to comment.