topkat-utils
Version:
A comprehensive collection of TypeScript/JavaScript utility functions for common programming tasks. Includes validation, object manipulation, date handling, string formatting, and more. Zero dependencies, fully typed, and optimized for performance.
12 lines (11 loc) • 557 B
TypeScript
/** @return undefined if cannot find _id */
export declare function getId(obj: any): string | undefined;
/** Merge filter with correct handling of OR and AND
* @param {Object} filterA
* @param {Object} filterB
* @param {Boolean} assignToFilterA defualt false: if true, it will modify filterA, else it will return merged filters as a new object
*/
export declare function mongoFilterMerger(filterA: any, filterB: any, assignToFilterA?: boolean): any;
export declare function mongoPush(field: string, value: any, fields: {
[k: string]: any;
}): void;