UNPKG

@webiny/api-headless-cms-ddb-es

Version:

DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.

16 lines (15 loc) 581 B
import WebinyError from "@webiny/error"; export const getWhereValues = (value, condition) => { const values = value; if (!Array.isArray(values)) { throw new WebinyError(`Trying to run filtering with "${condition}", but the value sent is not an array.`, `MALFORMED_${condition}_CONDITION`, { value }); } else if (values.length === 0) { throw new WebinyError(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, { value }); } return values; }; //# sourceMappingURL=values.js.map