| 1599 | */ |
| 1600 | |
| 1601 | function _isManuallyPopulatedArray(val, ref) { |
| 1602 | if (!Array.isArray(val)) { |
| 1603 | return false; |
| 1604 | } |
| 1605 | if (val.length === 0) { |
| 1606 | return false; |
| 1607 | } |
| 1608 | |
| 1609 | for (const el of val) { |
| 1610 | if (!(el instanceof Document)) { |
| 1611 | return false; |
| 1612 | } |
| 1613 | const modelName = el.constructor.modelName; |
| 1614 | if (modelName == null) { |
| 1615 | return false; |
| 1616 | } |
| 1617 | if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) { |
| 1618 | return false; |
| 1619 | } |
| 1620 | } |
| 1621 | |
| 1622 | return true; |
| 1623 | } |
| 1624 | |
| 1625 | /** |
| 1626 | * Sets the value of a path, or many paths. |