find.js 490 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. /* eslint-disable no-redeclare */
  7. // $FlowFixMe
  8. var find = Array.prototype.find ? function (list, predicate) {
  9. return Array.prototype.find.call(list, predicate);
  10. } : function (list, predicate) {
  11. for (var _i2 = 0; _i2 < list.length; _i2++) {
  12. var value = list[_i2];
  13. if (predicate(value)) {
  14. return value;
  15. }
  16. }
  17. };
  18. var _default = find;
  19. exports.default = _default;