diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 64c07be6e..3ada1267f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -2052,43 +2052,67 @@ module TestAny { let listIterator: (value: TResult, index: number, collection: _.List) => boolean; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean; - let result: boolean; + { + let result: boolean; - result = _.any(array); - result = _.any(array, listIterator); - result = _.any(array, listIterator, any); - result = _.any(array, ''); - result = _.any<{a: number}, TResult>(array, {a: 42}); + result = _.any(array); + result = _.any(array, listIterator); + result = _.any(array, listIterator, any); + result = _.any(array, ''); + result = _.any<{a: number}, TResult>(array, {a: 42}); - result = _.any(list); - result = _.any(list, listIterator); - result = _.any(list, listIterator, any); - result = _.any(list, ''); - result = _.any<{a: number}, TResult>(list, {a: 42}); + result = _.any(list); + result = _.any(list, listIterator); + result = _.any(list, listIterator, any); + result = _.any(list, ''); + result = _.any<{a: number}, TResult>(list, {a: 42}); - result = _.any(dictionary); - result = _.any(dictionary, dictionaryIterator); - result = _.any(dictionary, dictionaryIterator, any); - result = _.any(dictionary, ''); - result = _.any<{a: number}, TResult>(dictionary, {a: 42}); + result = _.any(dictionary); + result = _.any(dictionary, dictionaryIterator); + result = _.any(dictionary, dictionaryIterator, any); + result = _.any(dictionary, ''); + result = _.any<{a: number}, TResult>(dictionary, {a: 42}); - result = _(array).any(); - result = _(array).any(listIterator); - result = _(array).any(listIterator, any); - result = _(array).any(''); - result = _(array).any<{a: number}>({a: 42}); + result = _(array).any(); + result = _(array).any(listIterator); + result = _(array).any(listIterator, any); + result = _(array).any(''); + result = _(array).any<{a: number}>({a: 42}); - result = _(list).any(); - result = _(list).any(listIterator); - result = _(list).any(listIterator, any); - result = _(list).any(''); - result = _(list).any<{a: number}>({a: 42}); + result = _(list).any(); + result = _(list).any(listIterator); + result = _(list).any(listIterator, any); + result = _(list).any(''); + result = _(list).any<{a: number}>({a: 42}); - result = _(dictionary).any(); - result = _(dictionary).any(dictionaryIterator); - result = _(dictionary).any(dictionaryIterator, any); - result = _(dictionary).any(''); - result = _(dictionary).any<{a: number}>({a: 42}); + result = _(dictionary).any(); + result = _(dictionary).any(dictionaryIterator); + result = _(dictionary).any(dictionaryIterator, any); + result = _(dictionary).any(''); + result = _(dictionary).any<{a: number}>({a: 42}); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().any(); + result = _(array).chain().any(listIterator); + result = _(array).chain().any(listIterator, any); + result = _(array).chain().any(''); + result = _(array).chain().any<{a: number}>({a: 42}); + + result = _(list).chain().any(); + result = _(list).chain().any(listIterator); + result = _(list).chain().any(listIterator, any); + result = _(list).chain().any(''); + result = _(list).chain().any<{a: number}>({a: 42}); + + result = _(dictionary).chain().any(); + result = _(dictionary).chain().any(dictionaryIterator); + result = _(dictionary).chain().any(dictionaryIterator, any); + result = _(dictionary).chain().any(''); + result = _(dictionary).chain().any<{a: number}>({a: 42}); + } } // _.at @@ -2701,43 +2725,67 @@ module TestSome { let listIterator: (value: TResult, index: number, collection: _.List) => boolean; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean; - let result: boolean; + { + let result: boolean; - result = _.some(array); - result = _.some(array, listIterator); - result = _.some(array, listIterator, any); - result = _.some(array, ''); - result = _.some<{a: number}, TResult>(array, {a: 42}); + result = _.some(array); + result = _.some(array, listIterator); + result = _.some(array, listIterator, any); + result = _.some(array, ''); + result = _.some<{a: number}, TResult>(array, {a: 42}); - result = _.some(list); - result = _.some(list, listIterator); - result = _.some(list, listIterator, any); - result = _.some(list, ''); - result = _.some<{a: number}, TResult>(list, {a: 42}); + result = _.some(list); + result = _.some(list, listIterator); + result = _.some(list, listIterator, any); + result = _.some(list, ''); + result = _.some<{a: number}, TResult>(list, {a: 42}); - result = _.some(dictionary); - result = _.some(dictionary, dictionaryIterator); - result = _.some(dictionary, dictionaryIterator, any); - result = _.some(dictionary, ''); - result = _.some<{a: number}, TResult>(dictionary, {a: 42}); + result = _.some(dictionary); + result = _.some(dictionary, dictionaryIterator); + result = _.some(dictionary, dictionaryIterator, any); + result = _.some(dictionary, ''); + result = _.some<{a: number}, TResult>(dictionary, {a: 42}); - result = _(array).some(); - result = _(array).some(listIterator); - result = _(array).some(listIterator, any); - result = _(array).some(''); - result = _(array).some<{a: number}>({a: 42}); + result = _(array).some(); + result = _(array).some(listIterator); + result = _(array).some(listIterator, any); + result = _(array).some(''); + result = _(array).some<{a: number}>({a: 42}); - result = _(list).some(); - result = _(list).some(listIterator); - result = _(list).some(listIterator, any); - result = _(list).some(''); - result = _(list).some<{a: number}>({a: 42}); + result = _(list).some(); + result = _(list).some(listIterator); + result = _(list).some(listIterator, any); + result = _(list).some(''); + result = _(list).some<{a: number}>({a: 42}); - result = _(dictionary).some(); - result = _(dictionary).some(dictionaryIterator); - result = _(dictionary).some(dictionaryIterator, any); - result = _(dictionary).some(''); - result = _(dictionary).some<{a: number}>({a: 42}); + result = _(dictionary).some(); + result = _(dictionary).some(dictionaryIterator); + result = _(dictionary).some(dictionaryIterator, any); + result = _(dictionary).some(''); + result = _(dictionary).some<{a: number}>({a: 42}); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().some(); + result = _(array).chain().some(listIterator); + result = _(array).chain().some(listIterator, any); + result = _(array).chain().some(''); + result = _(array).chain().some<{a: number}>({a: 42}); + + result = _(list).chain().some(); + result = _(list).chain().some(listIterator); + result = _(list).chain().some(listIterator, any); + result = _(list).chain().some(''); + result = _(list).chain().some<{a: number}>({a: 42}); + + result = _(dictionary).chain().some(); + result = _(dictionary).chain().some(dictionaryIterator); + result = _(dictionary).chain().some(dictionaryIterator, any); + result = _(dictionary).chain().some(''); + result = _(dictionary).chain().some<{a: number}>({a: 42}); + } } result = _.sortBy([1, 2, 3], function (num) { return Math.sin(num); }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 6cfb630b8..5ea27909a 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -3322,6 +3322,56 @@ declare module _ { ): boolean; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.some + */ + any( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + any( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + any( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.some + */ + any( + predicate?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + any( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + any( + predicate?: TObject + ): LoDashExplicitWrapper; + } + //_.at interface LoDashStatic { /** @@ -6042,6 +6092,56 @@ declare module _ { ): boolean; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): LoDashExplicitWrapper; + } + //_.sortBy interface LoDashStatic { /**