change-string-case/node_modules/@octokit/endpoint/dist-src/with-defaults.js

17 lines
477 B
JavaScript
Raw Normal View History

2022-11-04 00:55:07 +08:00
import { endpointWithDefaults } from "./endpoint-with-defaults";
import { merge } from "./merge";
import { parse } from "./parse";
2023-10-26 04:27:07 +08:00
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),
parse
});
2022-11-04 00:55:07 +08:00
}
2023-10-26 04:27:07 +08:00
export {
withDefaults
};