[-] DanHulton@programming.dev 1 points 1 year ago* (last edited 1 year ago)

If you're not married to functional code, for searching a keyed object by property for the key, you can always write:

for (const key in data) {
  if (data[key].firstName === 'Frederic') {
    console.log(key);
  }
}

No need to transform the whole object with Object.entries, and you could turn that into a function reasonably easy, something like findKey(object, property, value) or some such.

[-] DanHulton@programming.dev 1 points 1 year ago

Came here to write this, so you get my upvote instead.

I don't actually use Hurl, I use Jest (since I'm usually writing in TS) so that I can prep state before and confirm it afterwards and fully ensure that the request did what it was supposed to do, but if you're already just using Postman, you're likely not testing your state, and Hurl is a SIGNIFICANT improvement.

Edit text files in any editor. Run it from the command line. Include it in your CICD with ease. It's an incredible tool and it deseres to be far, far more popular than it is.

DanHulton

joined 1 year ago