(request: ElectronPersistenceRequestEnvelope)
| 75 | } |
| 76 | |
| 77 | function 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 | |
| 103 | async function executeRequestAgainstAdapter( |
| 104 | request: ElectronPersistenceRequestEnvelope, |
no outgoing calls
no test coverage detected