mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Fix Enumerable#isAny second param type (#23827)
* Fix Enumerable#isAny param type https://emberjs.com/api/ember/3.0/classes/Ember.NativeArray/methods/isAny?anchor=isAny * Update Enum#isAny and #isEvery params to any
This commit is contained in:
Vendored
+2
-2
@@ -1182,7 +1182,7 @@ declare module 'ember' {
|
||||
* argument for all items in the enumerable. This method is often simpler/faster
|
||||
* than using a callback.
|
||||
*/
|
||||
isEvery(key: string, value: boolean): boolean;
|
||||
isEvery(key: string, value: any): boolean;
|
||||
/**
|
||||
* Returns `true` if the passed function returns true for any item in the
|
||||
* enumeration.
|
||||
@@ -1193,7 +1193,7 @@ declare module 'ember' {
|
||||
* argument for any item in the enumerable. This method is often simpler/faster
|
||||
* than using a callback.
|
||||
*/
|
||||
isAny(key: string, value?: boolean): boolean;
|
||||
isAny(key: string, value?: any): boolean;
|
||||
/**
|
||||
* This will combine the values of the enumerator into a single value. It
|
||||
* is a useful way to collect a summary value from an enumeration. This
|
||||
|
||||
@@ -15,7 +15,7 @@ const people = Ember.A([
|
||||
assertType<number>(people.get('length'));
|
||||
assertType<Person>(people.get('lastObject'));
|
||||
assertType<boolean>(people.isAny('isHappy'));
|
||||
assertType<boolean>(people.isAny('isHappy', false));
|
||||
assertType<boolean>(people.isAny('isHappy', 'false'));
|
||||
assertType<Ember.Enumerable<Person>>(people.filterBy('isHappy'));
|
||||
assertType<Ember.Enumerable<Person>>(people.rejectBy('isHappy'));
|
||||
assertType<Ember.Enumerable<Person>>(people.filter((person) => person.get('name') === 'Yehuda'));
|
||||
|
||||
@@ -131,7 +131,7 @@ const isHappy = (person: typeof Person3.prototype): boolean => {
|
||||
people2.every(isHappy);
|
||||
people2.any(isHappy);
|
||||
people2.isEvery('isHappy', true);
|
||||
people2.isAny('isHappy', true);
|
||||
people2.isAny('isHappy', 'true');
|
||||
people2.isAny('isHappy');
|
||||
|
||||
// Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html
|
||||
|
||||
Reference in New Issue
Block a user