( obj: Record<string, any>, parentPath: string, )
| 1900 | } |
| 1901 | |
| 1902 | function assertNoNestedIncludes( |
| 1903 | obj: Record<string, any>, |
| 1904 | parentPath: string, |
| 1905 | ): void { |
| 1906 | for (const [key, value] of Object.entries(obj)) { |
| 1907 | if (key.startsWith(`__SPREAD_SENTINEL__`)) continue |
| 1908 | if (value instanceof IncludesSubquery) { |
| 1909 | throw new Error( |
| 1910 | `Includes subqueries must be at the top level of select(). ` + |
| 1911 | `Found nested includes at "${parentPath}.${key}".`, |
| 1912 | ) |
| 1913 | } |
| 1914 | if (isNestedSelectObject(value)) { |
| 1915 | assertNoNestedIncludes(value, `${parentPath}.${key}`) |
| 1916 | } |
| 1917 | } |
| 1918 | } |
| 1919 | |
| 1920 | /** |
| 1921 | * Replaces an IncludesSubquery entry in the select object with a null Value placeholder. |
no test coverage detected