| 1505 | */ |
| 1506 | |
| 1507 | function _isManuallyPopulatedArray(val, ref) { |
| 1508 | if (!Array.isArray(val)) { |
| 1509 | return false; |
| 1510 | } |
| 1511 | if (val.length === 0) { |
| 1512 | return false; |
| 1513 | } |
| 1514 | |
| 1515 | for (const el of val) { |
| 1516 | if (!(el instanceof Document)) { |
| 1517 | return false; |
| 1518 | } |
| 1519 | const modelName = el.constructor.modelName; |
| 1520 | if (modelName == null) { |
| 1521 | return false; |
| 1522 | } |
| 1523 | if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) { |
| 1524 | return false; |
| 1525 | } |
| 1526 | } |
| 1527 | |
| 1528 | return true; |
| 1529 | } |
| 1530 | |
| 1531 | /** |
| 1532 | * Sets the value of a path, or many paths. |