UNPKG

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

Version:

DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.

32 lines (29 loc) 662 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformValueForSearch = void 0; /** * We use any for input and output because they really can be anything. * Plugin, if exists, makes sure that response value is correct. */ /** * Transformed value can be anything. */ const transformValueForSearch = params => { const { field, plugins, value } = params; const plugin = plugins[field.type]; if (!plugin) { return value; } return plugin.transform({ field, value }); }; exports.transformValueForSearch = transformValueForSearch; //# sourceMappingURL=transformValueForSearch.js.map