UNPKG

firestore-search-engine

Version:

Firestore Search Engine is a powerful helper library for enhancing search functionality in Firestore. Designed to handle misspellings, prefixes, and phonetic matching, this package generates multiple search variations for optimized approximate search resu

16 lines (15 loc) 830 B
import type { Change } from "firebase-functions"; import type { QueryDocumentSnapshot } from "firebase-functions/firestore"; /** * This function compares the 'before' and 'after' snapshots of a Firestore document and returns an object containing the changes, added, and removed fields. * It uses a custom deep equal function to compare objects. * @param {Object} data - The snapshot data containing the before and after Firestore document snapshots. * @returns {Object} - An object containing the changes, added, and removed fields. */ export declare const getDiffFromUpdatedData: <T extends object>(data: Change<QueryDocumentSnapshot>) => { before: T; after: T; changes: Partial<Record<keyof T, T[keyof T]>>; added: Partial<Record<keyof T, T[keyof T]>>; removed: Partial<Record<keyof T, T[keyof T]>>; };