1 | import { endpointWithDefaults } from "./endpoint-with-defaults.js";
|
2 | import { merge } from "./merge.js";
|
3 | import { parse } from "./parse.js";
|
4 | function withDefaults(oldDefaults, newDefaults) {
|
5 | const DEFAULTS = merge(oldDefaults, newDefaults);
|
6 | const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
7 | return Object.assign(endpoint, {
|
8 | DEFAULTS,
|
9 | defaults: withDefaults.bind(null, DEFAULTS),
|
10 | merge: merge.bind(null, DEFAULTS),
|
11 | parse
|
12 | });
|
13 | }
|
14 | export {
|
15 | withDefaults
|
16 | };
|