Function: isInternalDoc()
function isInternalDoc(doc, options): boolean;
Defined in: packages/client/src/core/sync/internal-docs.ts:230
Reports whether a document describes device-local state rather than stack data.
Parameters
| Parameter | Type | Description |
|---|---|---|
doc | MaybeInternalDoc | The document to classify. A missing or id-less value counts as internal, so a malformed change never escapes to a remote. |
options | InternalDocFilterOptions | Which of the optional categories to treat as replicable. |
Returns
boolean
true when the document should stay on this device.
Example
isInternalDoc({ _id: "~system" }); // true
isInternalDoc({ _id: "Task-1", "~class": "Task" }); // false
isInternalDoc({ _id: "sess-a", "~class": "~UserSession" }); // true
isInternalDoc({ _id: "sess-a", "~class": "~UserSession" }, { replicateSessions: true }); // false