tribe
Version:
Tribe is a platform for building rich, powerful, highly scalable distributed HTML5 web and mobile systems.
22 lines (20 loc) • 721 B
JavaScript
var utils = require('tribe/utilities'),
path = require('path'),
fs = require('q-io/fs'),
_ = require('underscore');
module.exports = function (property) {
var combine = {
to: function (targetPath, targetProperty) {
targetProperty = targetProperty || 'output';
return function (context) {
var result = _.pluck(context[property], 'content').join('\n');
if (targetPath) {
context[targetProperty] = context[targetProperty] || {};
context[targetProperty][targetPath] = result;
}
return result;
};
}
};
return combine;
};