getOwnDataDescriptor = (
  candidate,
  propName,
  shouldBeEnumerable,
  check,
) => {
  const desc = /** @type {PropertyDescriptor} */ (
    getOwnPropertyDescriptor(candidate, propName)
  );
  return (desc !== undefined ||
    (!!check && CX(check)`${q(propName)} property expected: ${candidate}`)) &&
    (hasOwnPropertyOf(desc, 'value') ||
      (!!check &&
        CX(
          check,
        )`${q(propName)} must not be an accessor property: ${candidate}`)) &&
    (shouldBeEnumerable
      ? desc.enumerable ||
        (!!check &&
          CX(
            check,
          )`${q(propName)} must be an enumerable property: ${candidate}`)
      : !desc.enumerable ||
        (!!check &&
          CX(
            check,
          )`${q(propName)} must not be an enumerable property: ${candidate}`))
    ? desc
    : /** @type {PropertyDescriptor} */ (/** @type {unknown} */ (undefined));
}
Verifies the presence and enumerability of an own data property
and returns its descriptor.

@param {object} candidate
@param {string|number|symbol} propName
@param {boolean} shouldBeEnumerable
@param {Checker} [check]
@returns {PropertyDescriptor}