Skip to content

Instantly share code, notes, and snippets.

@jasonbellamy
Created June 16, 2016 14:29
Show Gist options
  • Save jasonbellamy/abd9383e7bc1831ba5a74400c0be410e to your computer and use it in GitHub Desktop.
Save jasonbellamy/abd9383e7bc1831ba5a74400c0be410e to your computer and use it in GitHub Desktop.
var xs = {
template: [
{template: 'one', dest: 'two'},
{template: 'one', dest: 'two'}
],
copy: [
{template: 'one', dest: 'two'},
{template: 'one', dest: 'two'}
]
};
const copy = ({template, dest}) => {
return this.fs.copyTpl(
this.templatePath(template),
this.destinationPath(dest),
this.props
);
}
return Object.keys(xs)
.map(key => xs[key])
.reduce((x, y) => [...x, ...y])
.map(copy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment