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:
Theron Cross
2018-02-26 12:46:41 -08:00
committed by Andy
parent 27be94dcba
commit bd8ace8ec9
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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'));
+1 -1
View File
@@ -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