When includeArrays is used & an array expression has a non-whitespace character preceding it, an error is thrown. Example:
import { commaLists } from 'common-tags';
let templ, myArray = [ 'a', 'b', 'c' ];
// Does not work
templ = commaLists`
(${myArray})
`;
// Add a space before the expression & suddenly it works.
templ = commaLists`
( ${myArray})
`;
I believe it's reasonable to expect to be able to produce output like (a, b, c).
The error is Cannot read property '1' of null, stemming from this line in tags.js:
When includeArrays is used & an array expression has a non-whitespace character preceding it, an error is thrown. Example:
I believe it's reasonable to expect to be able to produce output like
(a, b, c)
.The error is
Cannot read property '1' of null
, stemming from this line in tags.js:If there's no whitespace at the end of accumulator to copy, perhaps it could default to using a single space.