/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/core-js/modules/es.iterator.every.js
32 строки
1 KB
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var iterate = require('../internals/iterate'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var getIteratorDirect = require('../internals/get-iterator-direct'); var iteratorClose = require('../internals/iterator-close'); var iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error'); var everyWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('every', TypeError); // `Iterator.prototype.every` method // https://tc39.es/ecma262/#sec-iterator.prototype.every $({ target: 'Iterator', proto: true, real: true, forced: everyWithoutClosingOnEarlyError }, { every: function every(predicate) { anObject(this); try { aCallable(predicate); } catch (error) { iteratorClose(this, 'throw', error); } if (everyWithoutClosingOnEarlyError) return call(everyWithoutClosingOnEarlyError, this, predicate); var record = getIteratorDirect(this); var counter = 0; return !iterate(record, function (value, stop) { if (!predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } });