diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 4c587b57b..fc2719a96 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -5297,11 +5297,30 @@ result = <_.LoDashImplicitObjectWrapper>_({ '0': 'zero', '1': 'one', 'l console.log(key); }); -result = _.functions(_); -result = _.methods(_); +// _.functions +module TestFunctions { + type SampleObject = {a: number; b: string; c: boolean;}; -result = <_.LoDashImplicitArrayWrapper>_(_).functions(); -result = <_.LoDashImplicitArrayWrapper>_(_).methods(); + let object: SampleObject; + + { + let result: string[]; + + result = _.functions(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).functions(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().functions(); + } +} // _.get result = _.get({ 'a': [{ 'b': { 'c': 3 } }] }, 'a[0].b.c'); @@ -5444,6 +5463,31 @@ module TestMerge { result = _({}).merge({}, {}, {}, {}, {}, customizer, any).value(); } +// _.methods +module TestFunctions { + type SampleObject = {a: number; b: string; c: boolean;}; + + let object: SampleObject; + + { + let result: string[]; + + result = _.methods(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).methods(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().methods(); + } +} + interface HasName { name: string; } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 98d8bf55d..970acffff 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10069,29 +10069,28 @@ declare module _ { //_.functions interface LoDashStatic { /** - * 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. - **/ - functions(object: any): string[]; - - /** - * @see _functions - **/ - methods(object: any): string[]; + * Creates an array of function property names from all enumerable properties, own and inherited, of object. + * + * @alias _.methods + * + * @param object The object to inspect. + * @return Returns the new array of property names. + */ + functions(object: any): string[]; } interface LoDashImplicitObjectWrapper { /** - * @see _.functions - **/ + * @see _.functions + */ functions(): _.LoDashImplicitArrayWrapper; + } + interface LoDashExplicitObjectWrapper { /** - * @see _.functions - **/ - methods(): _.LoDashImplicitArrayWrapper; + * @see _.functions + */ + functions(): _.LoDashExplicitArrayWrapper; } //_.get @@ -10462,6 +10461,28 @@ declare module _ { ): LoDashImplicitObjectWrapper; } + //_.methods + interface LoDashStatic { + /** + * @see _.functions + */ + methods(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.functions + */ + methods(): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.functions + */ + methods(): _.LoDashExplicitArrayWrapper; + } + //_.omit interface LoDashStatic { /**