MCPcopy
hub / github.com/angular/angularfire / checkOperationCases

Function checkOperationCases

src/compat/database/utils.ts:32–41  ·  view source on GitHub ↗
(item: FirebaseOperation, cases: FirebaseOperationCases)

Source from the content-addressed store, hash-verified

30}
31
32export function checkOperationCases(item: FirebaseOperation, cases: FirebaseOperationCases): Promise<void> {
33 if (isString(item)) {
34 return cases.stringCase();
35 } else if (isFirebaseRef(item)) {
36 return cases.firebaseCase();
37 } else if (isFirebaseDataSnapshot(item)) {
38 return cases.snapshotCase();
39 }
40 throw new Error(`Expects a string, snapshot, or reference. Got: ${typeof item}`);
41}

Callers 2

createRemoveMethodFunction · 0.90

Calls 3

isStringFunction · 0.85
isFirebaseRefFunction · 0.85
isFirebaseDataSnapshotFunction · 0.85

Tested by

no test coverage detected