Skip to content

Commit

Permalink
uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Aug 27, 2024
1 parent 560b6ac commit dbea3cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ const pkg = require("../package.json");

const utils = {
// HTTP method + ID + route name: POST1234/foo OR 1234/foo
// method is gathered from the insomnia-mock-method header
// id is first slug of the url and path is the rest of the url
// NOTE: http method GET is ingored in the compound id in order to preserve existing mocks
// compoundId is used to store and retrieve mocks from redis
createCompoundId: (method, id, path) => {
return method?.toLowerCase() === "get"
return method?.toUpperCase() === "GET"
? id + path
: (method || "") + id + path;
: (method?.toUpperCase() || "") + id + path;
},
objectToArray: (obj) => {
if (!obj || typeof obj !== "object") {
Expand Down

0 comments on commit dbea3cd

Please sign in to comment.