String identity template tag

T.J. Crowder tj.crowder at
Thu Dec 13 18:44:29 UTC 2018

On Thu, Dec 13, 2018 at 6:37 PM T.J. Crowder
<tj.crowder at> wrote:
> But called normally, it's a useful helper, for instance in
> Isiah's `escape`...

Going through the process of the example for my message just now made me
think more about this function. Suppose it:

1. Accepted an array of substitutions rather than a rest parameter, and

2. Accepted an optional mapping function

Then, what I wrote on my last message as:

const escape = (strings, ...subs) => {
    return String.cook(strings,;

would be

const escape = (strings, ...subs) => *String.cook(strings, subs,

...while still supporting the earlier usage (just without spread) if

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list