diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d1fc4e72c7..6d66befd7a 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1542,7 +1542,15 @@ result = _({ 'a': [{ 'b': { 'c': 3 } }] }).get(['a', '0', 'b', ' result = _({ 'a': [{ 'b': { 'c': 3 } }] }).get('a.b.c', 'default'); // → 'default' -result = _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); +// _.has +result = _.has({}, ''); +result = _.has({}, 42); +result = _.has({}, true); +result = _.has({}, ['', 42, true]); +result = _({}).has(''); +result = _({}).has(42); +result = _({}).has(true); +result = _({}).has(['', 42, true]); interface FirstSecond { first: string; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index fee53ca1fe..7d1e64492e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -7171,12 +7171,20 @@ declare module _ { //_.has interface LoDashStatic { /** - * Checks if path is a direct property. - * @param object The object to query. - * @param path The path to check. - * @return True if path is a direct property, else False. - **/ - has(object: any, path: string|string[]): boolean; + * Checks if path is a direct property. + * + * @param object The object to query. + * @param path The path to check. + * @return Returns true if path is a direct property, else false. + */ + has(object: any, path: string|number|boolean|Array): boolean; + } + + interface LoDashObjectWrapper { + /** + * @see _.has + */ + has(path: string|number|boolean|Array): boolean; } //_.invert