mirror of
https://github.com/actions/setup-node
synced 2024-11-10 07:32:40 +00:00
14 lines
481 B
JavaScript
14 lines
481 B
JavaScript
|
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
|
||
|
});
|
||
|
}
|