MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / checkOptions

Function checkOptions

src/index.ts:34–41  ·  view source on GitHub ↗
(options: ReactFireOptions, field: string)

Source from the content-addressed store, hash-verified

32}
33
34export 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
43export function checkinitialData(options: ReactFireOptions) {
44 return checkOptions(options, 'initialData');

Callers 2

checkinitialDataFunction · 0.85
checkIdFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected