functions.js 308 B

123456789101112131415
  1. define(['./isFunction'], function (isFunction) {
  2. // Return a sorted list of the function names available on the object.
  3. function functions(obj) {
  4. var names = [];
  5. for (var key in obj) {
  6. if (isFunction(obj[key])) names.push(key);
  7. }
  8. return names.sort();
  9. }
  10. return functions;
  11. });