functionsIn.js 714 B

1234567891011121314151617181920212223242526272829303132
  1. var baseFunctions = require('./_baseFunctions'),
  2. keysIn = require('./keysIn');
  3. /**
  4. * Creates an array of function property names from own and inherited
  5. * enumerable properties of `object`.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @since 4.0.0
  10. * @category Object
  11. * @param {Object} object The object to inspect.
  12. * @returns {Array} Returns the function names.
  13. * @see _.functions
  14. * @example
  15. *
  16. * function Foo() {
  17. * this.a = _.constant('a');
  18. * this.b = _.constant('b');
  19. * }
  20. *
  21. * Foo.prototype.c = _.constant('c');
  22. *
  23. * _.functionsIn(new Foo);
  24. * // => ['a', 'b', 'c']
  25. */
  26. function functionsIn(object) {
  27. return object == null ? [] : baseFunctions(object, keysIn(object));
  28. }
  29. module.exports = functionsIn;