1
0
Files

14 lines
482 B
JavaScript
Raw Permalink Normal View History

2019-08-06 17:37:58 -04:00
import { endpointWithDefaults } from "./endpoint-with-defaults";
import { merge } from "./merge";
import { parse } from "./parse";
export function withDefaults(oldDefaults, newDefaults) {
const DEFAULTS = merge(oldDefaults, newDefaults);
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
return Object.assign(endpoint, {
DEFAULTS,
defaults: withDefaults.bind(null, DEFAULTS),
merge: merge.bind(null, DEFAULTS),
2020-05-15 15:25:57 -04:00
parse,
2019-08-06 17:37:58 -04:00
});
}