mongo-dot-notation
Version:
Transform objects to MongoDB update instructions
17 lines (16 loc) • 505 B
TypeScript
export interface Operator {
}
/**
* Checks if a given object is an operator.
* @example
* ```ts
* isOperator($set(1)); // true
* isOperator({}); // false
* ```
* @param obj the object to check
* @returns `true` if the objects is an operator
*/
export declare const isOperator: <T>(obj: T) => boolean;
export declare const getType: (operator: any) => any;
export declare const getValue: (operator: any) => any;
export declare const create: <T, U = Operator>(type: string, value: T, obj?: U) => U;