source: node_modules/@swagger-api/apidom-reference/es/options/util.mjs

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 599 bytes
Line 
1import { mergeDeepRight, lens, path, assocPath, over } from 'ramda';
2import { isEmptyString } from 'ramda-adjunct';
3import { cwd } from "../util/url.mjs";
4/**
5 * Algorithm for deep merging options.
6 */
7const baseURILens = lens(path(['resolve', 'baseURI']), assocPath(['resolve', 'baseURI']));
8const baseURIDefault = baseURI => isEmptyString(baseURI) ? cwd() : baseURI;
9
10// eslint-disable-next-line import/prefer-default-export
11export const merge = (lObj, rObj) => {
12 const withoutDefaults = mergeDeepRight(lObj, rObj);
13 // @ts-ignore
14 return over(baseURILens, baseURIDefault, withoutDefaults);
15};
Note: See TracBrowser for help on using the repository browser.