MCPcopy Index your code
hub / github.com/TanStack/db / assertNoNestedIncludes

Function assertNoNestedIncludes

packages/db/src/query/compiler/index.ts:1902–1918  ·  view source on GitHub ↗
(
  obj: Record<string, any>,
  parentPath: string,
)

Source from the content-addressed store, hash-verified

1900}
1901
1902function 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.

Callers 1

Calls 2

isNestedSelectObjectFunction · 0.70
entriesMethod · 0.45

Tested by

no test coverage detected