UNPKG

@mason-api/javascript-sdk

Version:

Mason component rendering library

25 lines (22 loc) 670 B
import _ from 'lodash'; import embedComponents from './embedComponents'; import eventHandlers from './eventHandlers'; import path from './path'; import preventDefaults from './preventDefaults'; import removePrivateAttributes from './removePrivateAttributes'; import submitForm from './submitForm'; import tags from './tags'; export function applyTransformations(...transformations) { return getContext => (node, config, configSubpath) => _.reduce(transformations, (n, t) => t(getContext)(n, config, configSubpath), node); } export default [ embedComponents, eventHandlers, submitForm, tags, path, preventDefaults, removePrivateAttributes, ];