UNPKG

@scalar/api-client

Version:

the open source API testing client

19 lines (18 loc) 466 B
import { replaceVariables as c } from "@scalar/helpers/regex/replace-variables"; import { mergeUrls as a } from "@scalar/helpers/url/merge-urls"; const m = (r, e) => { if (!r.url) return e; const t = r.url; if (r.variables) { const i = Object.entries(r.variables).reduce( (l, [u, s]) => (s.default !== void 0 && (l[u] = s.default), l), {} ), o = c(t, i); return a(o, e); } return a(t, e); }; export { m as processServerUrl };