added _.functions/_.methods definitions

This commit is contained in:
Brian Zengel
2013-10-20 12:39:22 -04:00
parent 4061027995
commit 9ac60c8311
2 changed files with 15 additions and 13 deletions
+3
View File
@@ -578,6 +578,9 @@ _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
console.log(key);
});
_.functions(_);
_.methods(_);
var mergeNames = {
'stooges': [
{ 'name': 'moe' },
+12 -13
View File
@@ -2317,6 +2317,18 @@ declare module _ {
callback?: ObjectIterator<T, void>,
thisArg?: any): Dictionary<T>;
/**
* Creates a sorted array of property names of all enumerable properties, own and inherited, of
* object that have function values.
* @param object The object to inspect.
* @return An array of property names that have function values.
**/
export function functions(object: any): string[];
/**
* @see _functions
**/
export function methods(object: any): string[];
/**
* Recursively merges own enumerable properties of the source object(s), that don't resolve
@@ -2503,19 +2515,6 @@ declare module _ {
export function invert(object: any): any;
/**
* Returns a sorted list of the names of every method in an object - that is to say,
* the name of every function property of the object.
* @param object Object to pluck all function property names from.
* @return List of all the function names on `object`.
**/
export function functions(object: any): string[];
/**
* @see _functions
**/
export function methods(object: any): string[];
/**
* Return a copy of the object, filtered to only have values for the whitelisted keys
* (or array of valid keys).
* @param object Object to strip unwanted key/value pairs.