@webiny/api-headless-cms-ddb-es
Version:
DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.
24 lines (22 loc) • 850 B
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getWhereValues = void 0;
var _error = _interopRequireDefault(require("@webiny/error"));
const getWhereValues = (value, condition) => {
const values = value;
if (!Array.isArray(values)) {
throw new _error.default(`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 _error.default(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, {
value
});
}
return values;
};
exports.getWhereValues = getWhereValues;
//# sourceMappingURL=values.js.map
;