MCPcopy Create free account
hub / github.com/TanStack/db / assertValidRequest

Function assertValidRequest

packages/electron-db-sqlite-persistence/src/main.ts:77–101  ·  view source on GitHub ↗
(request: ElectronPersistenceRequestEnvelope)

Source from the content-addressed store, hash-verified

75}
76
77function assertValidRequest(request: ElectronPersistenceRequestEnvelope): void {
78 if (request.v !== ELECTRON_PERSISTENCE_PROTOCOL_VERSION) {
79 throw new InvalidPersistedCollectionConfigError(
80 `Unsupported electron persistence protocol version "${request.v}"`,
81 )
82 }
83
84 if (
85 typeof request.requestId !== `string` ||
86 request.requestId.trim().length === 0
87 ) {
88 throw new InvalidPersistedCollectionConfigError(
89 `Electron persistence requestId cannot be empty`,
90 )
91 }
92
93 if (
94 typeof request.collectionId !== `string` ||
95 request.collectionId.trim().length === 0
96 ) {
97 throw new InvalidPersistedCollectionConfigError(
98 `Electron persistence collectionId cannot be empty`,
99 )
100 }
101}
102
103async function executeRequestAgainstAdapter(
104 request: ElectronPersistenceRequestEnvelope,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected