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.

31 lines
714 B

4 years ago
  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;