UNPKG

@proofkit/fmodata

Version:

FileMaker OData API client

22 lines (21 loc) 802 B
import { ExpandBuilder } from "./expand-builder.js"; import { formatSelectFields } from "./select-utils.js"; function buildSelectExpandQueryString(config) { const parts = []; const expandBuilder = new ExpandBuilder(config.useEntityIds, config.logger); if (config.selectedFields && config.selectedFields.length > 0) { const selectString = formatSelectFields(config.selectedFields, config.table, config.useEntityIds); if (selectString) { parts.push(`$select=${selectString}`); } } const expandString = expandBuilder.buildExpandString(config.expandConfigs); if (expandString) { parts.push(`$expand=${expandString}`); } return parts.length > 0 ? `?${parts.join("&")}` : ""; } export { buildSelectExpandQueryString }; //# sourceMappingURL=query-string-builder.js.map