Ramda Adjunct 2.5.0

isObj.js

  1. import { both, anyPass } from 'ramda';
  2. import isNotNull from './isNotNull';
  3. import isFunction from './isFunction';
  4. import isOfTypeObject from './internal/isOfTypeObject';
  5. /* eslint-disable max-len */
  6. /**
  7. * Checks if input value is language type of `Object`.
  8. *
  9. * @func isObj
  10. * @aliases isObject
  11. * @memberOf RA
  12. * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
  13. * @category Type
  14. * @sig * -> Boolean
  15. * @param {*} val The value to test
  16. * @return {Boolean}
  17. * @see {@link RA.isNotObj|isNotObj}, {@link RA.isObjLike|isObjLike}, {@link RA.isPlainObj|isPlainObj}
  18. * @example
  19. *
  20. * RA.isObj({}); //=> true
  21. * RA.isObj([]); //=> true
  22. * RA.isObj(() => {}); //=> true
  23. * RA.isObj(null); //=> false
  24. * RA.isObj(undefined); //=> false
  25. */
  26. /* eslint-enable max-len */
  27. const isObj = both(isNotNull, anyPass([isOfTypeObject, isFunction]));
  28. export default isObj;