Template
1
0
mirror of https://github.com/actions/setup-node synced 2024-11-30 21:22:29 +08:00
setup-node/node_modules/@octokit/endpoint/dist-src/with-defaults.js

14 lines
481 B
JavaScript
Raw Permalink Normal View History

2019-08-06 03:18:52 +08: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),
parse
});
}