mirror of
https://github.com/swc-project/swc.git
synced 2025-01-02 10:37:56 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
15 lines
390 B
TypeScript
15 lines
390 B
TypeScript
// Loaded from https://deno.land/x/graphql_deno@v15.0.0/lib/polyfills/find.js
|
|
|
|
|
|
/* eslint-disable no-redeclare */
|
|
// $FlowFixMe
|
|
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; |