Last active
February 9, 2021 17:36
-
-
Save radekwarisch/e8a89bf2df96378b4ea5d57805535995 to your computer and use it in GitHub Desktop.
Copy templates util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const copyTemplatesAnd = <TInputType>( | |
...plugins: (ChainableType<TInputType>)[] | |
) => (input: TInputType) => () => { | |
const {templatesPath, movePath, templateVariables, tree} = input; | |
const newTemplates = apply(url(templatesPath), [ | |
template(templateVariables), | |
move(movePath), | |
...plugins.map(compose(input)), | |
]); | |
input.templates = newTemplates; | |
return tree; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment