sharec-core
Version:
[](https://github.com/lamartire/sharec/actions) [](https://npmjs.com/sharec)  • 485 B
JavaScript
// @ts-check
/**
* @typedef {import('../').FlowContext} FlowContext
* @typedef {import('../').FlowStep} FlowStep
* @typedef {import('../').Semaphore} Semaphore
*/
/**
* @param {'beforeMerge'|'afterMerge'} hook
* @returns {FlowStep}
*/
const readRuntimeConfig = (hook) => async (context, semaphore) => {
const { runtimeConfig = {} } = context
if (!runtimeConfig[hook]) return context
return runtimeConfig[hook](context, semaphore)
}
module.exports = readRuntimeConfig