You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
713 B

4 years ago
  1. import _curry3 from "./internal/_curry3.js";
  2. import is from "./is.js";
  3. /**
  4. * Returns `true` if the specified object property is of the given type;
  5. * `false` otherwise.
  6. *
  7. * @func
  8. * @memberOf R
  9. * @since v0.16.0
  10. * @category Type
  11. * @sig Type -> String -> Object -> Boolean
  12. * @param {Function} type
  13. * @param {String} name
  14. * @param {*} obj
  15. * @return {Boolean}
  16. * @see R.is, R.propSatisfies
  17. * @example
  18. *
  19. * R.propIs(Number, 'x', {x: 1, y: 2}); //=> true
  20. * R.propIs(Number, 'x', {x: 'foo'}); //=> false
  21. * R.propIs(Number, 'x', {}); //=> false
  22. */
  23. var propIs =
  24. /*#__PURE__*/
  25. _curry3(function propIs(type, name, obj) {
  26. return is(type, obj[name]);
  27. });
  28. export default propIs;