|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
662 bytes
|
| Line | |
|---|
| 1 | import { iteratee } from './iteratee.mjs';
|
|---|
| 2 |
|
|---|
| 3 | function overSome(...predicates) {
|
|---|
| 4 | return function (...values) {
|
|---|
| 5 | for (let i = 0; i < predicates.length; ++i) {
|
|---|
| 6 | const predicate = predicates[i];
|
|---|
| 7 | if (!Array.isArray(predicate)) {
|
|---|
| 8 | if (iteratee(predicate).apply(this, values)) {
|
|---|
| 9 | return true;
|
|---|
| 10 | }
|
|---|
| 11 | continue;
|
|---|
| 12 | }
|
|---|
| 13 | for (let j = 0; j < predicate.length; ++j) {
|
|---|
| 14 | if (iteratee(predicate[j]).apply(this, values)) {
|
|---|
| 15 | return true;
|
|---|
| 16 | }
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 | return false;
|
|---|
| 20 | };
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | export { overSome };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.