diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 01aedc432c..7db984bcca 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -8152,6 +8152,31 @@ module TestFunctions { } } +// _.functionsIn +module TestFunctionsIn { + type SampleObject = {a: number; b: string; c: boolean;}; + + let object: SampleObject; + + { + let result: string[]; + + result = _.functionsIn(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).functionsIn(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().functionsIn(); + } +} + // _.get result = _.get({ 'a': [{ 'b': { 'c': 3 } }] }, 'a[0].b.c'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 3f596a202c..e27022b9cd 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -99,9 +99,9 @@ added 18 lang methods: - [ ] _.toString added 13 object methods: -- [ ] _.assignIn -- [ ] _.assignInWith -- [ ] _.assignWith +- [x] _.assignIn +- [x] _.assignInWith +- [x] _.assignWith - [ ] _.functionsIn - [ ] _.hasIn - [ ] _.invoke @@ -13009,10 +13009,25 @@ declare module _ { //_.functions interface LoDashStatic { /** - * Creates an array of function property names from all enumerable properties, own and inherited, of object. + * Creates an array of function property names from own enumerable properties + * of `object`. * - * @param object The object to inspect. - * @return Returns the new array of property names. + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] */ functions(object: any): string[]; } @@ -13031,6 +13046,46 @@ declare module _ { functions(): _.LoDashExplicitArrayWrapper; } + //_.functionsIn + interface LoDashStatic { + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + functionsIn(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashExplicitArrayWrapper; + } + //_.get interface LoDashStatic { /**