firestore-snapshot-utils
Version:
[](https://github.com/ericvera/firestore-snapshot-utils/blob/master/LICENSE) [ • 854 B
TypeScript
/**
* Normalizes data by replacing all Timestamp and Buffer objects with
* standardized string representations.
*
* For Timestamps: /Timestamp 0000/ where the number represents the timestamp's
* position in the provided sorted array.
*
* For Buffers: /Buffer <base64url>/ where the base64url is the
* base64url-encoded value of the buffer.
*
* This function is idempotent - calling it multiple times with the same input
* will always produce the same output, and it doesn't modify any input
* parameters.
*
* @param value - The value to process
* @param sortedTimestamps - Array of timestamp values (from valueOf()) sorted
* chronologically
* @returns A new value with timestamps and buffers replaced by their normalized
* representations
*/
export declare const normalizeData: (value: unknown, sortedTimestamps: string[]) => unknown;