From 5566b0981806d02273a95665600c48e03c2e7c6f Mon Sep 17 00:00:00 2001 From: Daniel Furtado Date: Mon, 28 Dec 2015 19:03:37 +0100 Subject: [PATCH] Added _.propertyOf function --- underscore/underscore.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 87d5b0919..95dbd3bcf 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -1405,6 +1405,13 @@ interface UnderscoreStatic { **/ property(key: string): (object: Object) => any; + /** + * Returns a function that will itself return the value of a object key property. + * @param key The object to get the property value from. + * @return Function which accept a key property in `object` and returns its value. + **/ + propertyOf(object: Object): (key: string) => any; + /** * Performs an optimized deep comparison between the two objects, * to determine if they should be considered equal. @@ -2380,6 +2387,12 @@ interface Underscore { * @see _.property **/ property(): (object: Object) => any; + + /** + * Wrapped type `object`. + * @see _.propertyOf + **/ + propertyOf(): (key: string) => any; /** * Wrapped type `object`. @@ -3286,6 +3299,12 @@ interface _Chain { * @see _.property **/ property(): _Chain; + + /** + * Wrapped type `object`. + * @see _.propertyOf + **/ + propertyOf(): _Chain; /** * Wrapped type `object`.