UNPKG

kubo-rpc-client-esm-cjs

Version:
23 lines 748 B
import { configure } from '../../lib/configure.js'; import { toUrlSearchParams } from '../../lib/to-url-search-params.js'; export const createApply = configure(api => { /** * @type {import('../../types').ConfigProfilesAPI["apply"]} */ async function apply(profile, options = {}) { const res = await api.post('config/profile/apply', { signal: options.signal, searchParams: toUrlSearchParams({ arg: profile, ...options }), headers: options.headers }); const data = await res.json(); return { original: data.OldCfg, updated: data.NewCfg }; } return apply; }); //# sourceMappingURL=apply.js.map