ramda ifElse with props

I have the following object

const d = {
  a: 1,
  b: 2,
  c: 3,
}

What a I want to do is something like this:

const type = R.ifElse(R.isEmpty(R.prop('a')), "company", "personal")(d)

The equivalent in pure javascript would be

const type = d.a ? "personal" : "company"

How can I do this with ramda?

Answer

(Disclaimer: I have literally no experience with Ramda.js, I just looked it up and tried out a little bit. There may be a better solution)

You can use R.always instead of the strings, as it expects functions there. For checking if the object has a property you can use R.has

const d = {
  a: 1,
  b: 2,
  c: 3,
}
const x = R.ifElse(R.has('a'), R.always("company"), R.always("personal"))(d)