UNPKG

358 BJavaScriptView Raw
1// return a list of features to be inserted before or after cssdb features
2export default function getTransformedInsertions(insertions, placement) {
3 return Object.keys(insertions).map(
4 id => [].concat(insertions[id]).map(
5 plugin => ({
6 [placement]: true,
7 plugin,
8 id
9 })
10 )
11 ).reduce(
12 (array, feature) => array.concat(feature), []
13 );
14}