(options: ReactFireOptions, field: string)
| 32 | } |
| 33 | |
| 34 | export function checkOptions(options: ReactFireOptions, field: string) { |
| 35 | // make sure the field passed in is a valid key of ReactFire Options |
| 36 | if (field === 'idField' || field === 'initialData' || field === 'suspense') { |
| 37 | return options ? (options[field] as ReactFireOptions['idField'] | ReactFireOptions['initialData'] | ReactFireOptions['suspense']) : undefined; |
| 38 | } |
| 39 | |
| 40 | throw new Error(`Field "${field}" is not a valid key in ReactFireOptions`); |
| 41 | } |
| 42 | |
| 43 | export function checkinitialData(options: ReactFireOptions) { |
| 44 | return checkOptions(options, 'initialData'); |
no outgoing calls
no test coverage detected