Skip to content

Commit

Permalink
pass objects through
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent 041c5da commit f9c0514
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ exports.parse = function (s, env) {
var mapped = parse(s, env);
if (typeof env !== 'function') return mapped;
return mapped.reduce(function (acc, s) {
if (typeof s === 'object') return acc.concat(s);
var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
if (xs.length === 1) return acc.concat(xs[0]);
return acc.concat(xs.filter(Boolean).map(function (x) {
Expand Down

0 comments on commit f9c0514

Please sign in to comment.