UNPKG

sharec-core

Version:

[![.github/workflows/main.yml](https://github.com/lamartire/sharec/workflows/.github/workflows/main.yml/badge.svg)](https://github.com/lamartire/sharec/actions) [![npm](https://img.shields.io/npm/v/sharec)](https://npmjs.com/sharec) ![MIT License](https:/

22 lines (16 loc) 485 B
// @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