( change: EntityChange, context: SyncRequestContext )
| 25 | | EntityCreateChange; |
| 26 | |
| 27 | export function getEntityChangeSchema( |
| 28 | change: EntityChange, |
| 29 | context: SyncRequestContext |
| 30 | ) { |
| 31 | const { entity } = change; |
| 32 | |
| 33 | const schema = context.schema.entities.find((e) => e.name === entity); |
| 34 | |
| 35 | if (!schema) { |
| 36 | throw new Error(`No schema found for entity ${entity}`); |
| 37 | } |
| 38 | |
| 39 | return schema; |
| 40 | } |
no test coverage detected