flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
20
VISUALIZACION/node_modules/graphql/polyfills/find.js.flow
generated
vendored
Executable file
20
VISUALIZACION/node_modules/graphql/polyfills/find.js.flow
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
// @flow strict
|
||||
declare function find<T>(
|
||||
list: $ReadOnlyArray<T>,
|
||||
predicate: (item: T) => boolean,
|
||||
): T | void;
|
||||
|
||||
/* eslint-disable no-redeclare */
|
||||
// $FlowFixMe[name-already-bound]
|
||||
const find = Array.prototype.find
|
||||
? function (list, predicate) {
|
||||
return Array.prototype.find.call(list, predicate);
|
||||
}
|
||||
: function (list, predicate) {
|
||||
for (const value of list) {
|
||||
if (predicate(value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
};
|
||||
export default find;
|
||||
Loading…
Add table
Add a link
Reference in a new issue