@nerdware/ddb-single-table
Version:
A schema-based DynamoDB modeling tool, high-level API, and type-generator built to supercharge single-table designs!⚡
23 lines • 1.13 kB
TypeScript
import type { ItemWhereQuery, WhereQueryOperator, WhereQueryComparand } from "./types/index.js";
import type { ValueOf } from "type-fest";
/**
* A type representing the meta object returned by `getNormalizedComparisonMeta()`.
* It contains the `operator` and `comparand` for a given `WhereQuery` comparison.
*/
type ComparisonMetaObject = ValueOf<{
[Op in WhereQueryOperator]: {
operator: Op;
comparand: WhereQueryComparand<Op>;
};
}>;
/**
* This function takes a key-value pair from an {@link ItemWhereQuery} object,
* validates the values it contains, and if they're valid, returns the appropriate
* comparison `operator` and `comparand` to use in the `KeyConditionExpression`.
*
* @returns An {@link ComparisonMetaObject} containing the `operator` and `comparand` for the given `WhereQuery` comparison.
* @throws {InvalidExpressionError} if the args are invalid.
*/
export declare const getNormalizedComparisonMeta: (attrName: keyof ItemWhereQuery, whereQueryComparison: ValueOf<ItemWhereQuery>) => ComparisonMetaObject;
export {};
//# sourceMappingURL=getNormalizedComparisonMeta.d.ts.map