diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 89be7405b..612b9802d 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -742,6 +742,9 @@ var object = { result = _.result(object, 'cheese'); result = _.result(object, 'stuff'); +var tempObject = {}; +result = _.runInContext(tempObject); + ////////////////////////////////////////////////////////////////////////////////////////////////// var iceCream = { flavor: "chocolate" }; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 4be1561a4..5d9b3680f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2772,6 +2772,12 @@ declare module _ { **/ export function result(object: any, property: string): any; + /** + * Create a new lodash function using the given context object. + * @param context The context object + * @returns The lodash function. + **/ + export function runInContext(context: any): typeof _;