UNPKG

@probot/octokit-plugin-config

Version:

Get/set persisted configuration using YAML/JSON files in repositories

18 lines (17 loc) 484 B
import { getConfigFiles } from "./util/get-config-files.js"; async function composeConfigGet(octokit, { owner, repo, defaults, path, branch }) { const files = await getConfigFiles(octokit, { owner, repo, path, branch }); const configs = files.map((file) => file.config).reverse().filter(Boolean); return { files, config: typeof defaults === "function" ? defaults(configs) : Object.assign({}, defaults, ...configs) }; } export { composeConfigGet };